我想在我的代码中使用Volley哪些请求类型应该用于我的响应下面我无法理解。 URL ::: http://localhost/api/product/read.php排球JSON响应
{
"data":[
{
"category_id":"1",
"category_name":"Today's Recipe",
"recipes":[
{
"id":"1",
"recipe_name":"Peanut, and Chilli Noodles",
"ingredients":"Serves: 4 \r\n\r\n250g (9 oz) fresh Chinese ,
"prepration":"Prep:15min Cook:10min Ready in:25min \r\n\r\nCook
noodles in a large pot of boiling water until done. have
chilli paste, use minced red chilli to taste."
}
]
},
这似乎是一个JSON对象,所以你应该使用一个JsonObjectRequest https://developer.android.com/training/volley/request.html – joao86
你应该使用JsonRequest。请参阅我在本博客上的回答: https://stackoverflow.com/questions/47936955/i-am-unable-to-make-a-network-call-using-volley-i-have-tried-many-solutions -but/47937120#47937120 –
当我使用jsonobject请求时,出现以下错误显示::: com.android.volley.ParseError:org.json.JSONException:值java.lang.String类型的连接无法转换为JSONObject –