需要动态生成json字符串然后发送到服务器,不知道应该怎么实现?
使用了NSJSONSerialization
。
下面就是字符串:
{
"surveyid": "Survey1",
"responsetime": "dd/mm/yyyy hh:mm:ss",
"location": null,
"surveyresponses": [
{
"questionid": "111",
"responses": [
{
"response": "Good",
"optionid": 1,
"language": "en"
}
]
},
{
"questionid": "112",
"responses": [
{
"response": "bad",
"optionid": 2,
"language": "en"
}
]
}
]
}
创建一个string.json,请高手帮忙啊。谢谢