请问关于 json的问题
请问
response是 通过okhttp访问服务器返回的值。
String str1 = response.body().string();
JSONObject localJSONObject = new JSONObject(str1);
if (localJSONObject.optInt("errcode", -1) == 0){
。。。。。。。。
}
那么 (localJSONObject.optInt("errcode", -1) 这句代码的意思是什么呢? 麻烦知道的朋友帮忙回复。
而我百度查到的源码是:而它是一个参数的
public int optInt(String key) {
return this.optInt(key, 0);
}