org.json.JSONException: Unterminated string at 737 [character 738 line 1]

前端 未结 3 542
迷失自我
迷失自我 2021-01-12 15:54

I\'m using the org.json.JSONObject to parse some json being sent to my servlet by an iphone. I was stuck for a while by why I would be getting an error message at all. The e

相关标签:
3条回答
  • 2021-01-12 16:18

    If you're using the HTTP GET method to send data using query parameters, realize that there's a practical limit on the amount of data you can send that way. It's about 2000 characters (varies by server and client). You can easily exceed that when URL encoding a shorter string.

    0 讨论(0)
  • 2021-01-12 16:28

    Json won't work if received string contain new line character like \n. Try to check for it and escape the character.

    0 讨论(0)
  • 2021-01-12 16:37

    json work well with \n but if you have any other special charachters in your meesage like \ , @ , & , # etc.. first convert them into their respective HEX value and then send your message.

    0 讨论(0)
提交回复
热议问题