简体   繁体   English

只是一个值对JSON有效

[英]Just a value is valid for JSON

I want to know if the next value is valid as a JSON format 我想知道下一个值是否为JSON格式有效

1223452234

I am using AFNetworking in my iOS app and allow the parse of it with 我在iOS应用中使用AFNetworking,并允许使用

readingOptions: .AllowFragments

And it works... but it is a valid JSON? 而且有效...但这是有效的JSON吗? what's the name of that kind of things? 这种东西叫什么名字?

Thanks 谢谢

To my knowledge you must be in an array or object type for the root element. 据我所知,您必须位于根元素的数组或对象类型中。

This means you could have something like this if you really wanted it to be as "small and simple" as possible. 这意味着如果您真的希望它尽可能“小而简单”,那么您可能会有这样的事情。

[ 
     12341234 
]

or this if you need keys. 或者如果您需要按键,则此操作。

{
    "test": 321321312
}

I don't think the numbers by themselves are valid and they're definitely not standard. 我认为这些数字本身不是有效的,而且绝对不是标准的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM