Get a JSON object from a HTTP response

前端 未结 7 1423
粉色の甜心
粉色の甜心 2020-11-27 12:17

I want to get a JSON object from a Http get response:

Here is my current code for the Http get:

protected String doInBackground(String..         


        
7条回答
  •  隐瞒了意图╮
    2020-11-27 12:45

    The string that you get is just the JSON Object.toString(). It means that you get the JSON object, but in a String format.

    If you are supposed to get a JSON Object you can just put:

    JSONObject myObject = new JSONObject(result);
    

提交回复
热议问题