草庐IT

jsonobjectrequest

全部标签

java - 找不到适合 JsonObjectRequest 的构造函数

错误:Error:(164,40)error:nosuitableconstructorfoundforJsonObjectRequest(int,String,>,)constructorJsonObjectRequest.JsonObjectRequest(String,JSONObject,Listener,ErrorListener)isnotapplicable(actualargumentintcannotbeconvertedtoStringbymethodinvocationconversion)constructorJsonObjectRequest.JsonObje

android - Volley JsonObjectRequest 在 GET 请求中发送 header

我正在尝试从GET请求发送一些身份验证header,我尝试使用VolleyJsonObjectRequest调用:Mapparams=newHashMap();params.put("token","fghjbvjhnjjk");activity.showDialog();JsonObjectRequestreq=newJsonObjectRequest(Request.Method.GET,url,newJSONObject(params),newResponse.Listener(){@OverridepublicvoidonResponse(JSONObjectresponse)

android volley JsonObjectRequest 不返回 body 只是 200

如何在volley中发出JSON请求,我需要在正文中发送身份验证header和JSON对象,我希望只有状态代码200应答JsonObjectRequestrequest=newJsonObjectRequest(method,url,myJsonObject,responseListener,errorListener){@OverridepublicMapgetHeaders()throwsAuthFailureError{HashMapheaders=newHashMap();Stringcreds=String.format("%s:%s",login,password);Str

java - 为什么我的 JsonObjectRequest 不工作?

这几天我一直在摆弄这个。做错了。AndroidStudio不会让我用这个错误编译它。所以,我有这个应用程序,其中有两个选项卡和两个fragment。一个fragment称为new,该fragment获取json。但是我无法正确地做到这一点。我已经上传了错误的图片和类文件。你能帮帮我吗?错误:“无法解析构造函数JsonObjectRequest(int,java.lang.String,null......)new_fragment.javapublicclassnew_fragmentextendsFragment{privatestaticfinalStringARG_PARAM1=

android - 使用 JsonObjectRequest 时出现编译错误

我正在使用mcxiaoke/android-volley库。我得到的编译错误是Error:(77,37)error:referencetoJsonObjectRequestisambiguous,bothconstructorJsonObjectRequest(int,String,String,Listener,ErrorListener)inJsonObjectRequestandconstructorJsonObjectRequest(int,String,JSONObject,Listener,ErrorListener)inJsonObjectRequestmatch这是我的

android - Volley Post JsonObjectRequest 在使用 getHeader 和 getParams 时忽略参数

我正在尝试连接APIurl="apiaddress",它接受两种header类型application/json以json格式响应,application/xml以xml格式响应。我需要使用json参数访问JSON,响应也将采用json格式。使用带有JsonObjectRequest的androidvolleyPost请求使用getHeaders设置header,它连接到服务器但getParams设置参数不起作用。RequestQueuequeue=Volley.newRequestQueue(this);JsonObjectRequestjsonObjReq=newJsonObjec

android - Volley JsonObjectRequest Post 请求不起作用

我正在使用androidVolley发出请求。所以我使用这个代码。我不明白一件事。我在我的服务器中检查params始终为空。我认为getParams()不起作用。我应该怎么做才能解决这个问题。RequestQueuequeue=MyVolley.getRequestQueue();JsonObjectRequestjsObjRequest=newJsonObjectRequest(Request.Method.POST,SPHERE_URL,null,newResponse.Listener(){@OverridepublicvoidonResponse(JSONObjectrespo

android - Volley JsonObjectRequest Post 请求不起作用

我正在使用androidVolley发出请求。所以我使用这个代码。我不明白一件事。我在我的服务器中检查params始终为空。我认为getParams()不起作用。我应该怎么做才能解决这个问题。RequestQueuequeue=MyVolley.getRequestQueue();JsonObjectRequestjsObjRequest=newJsonObjectRequest(Request.Method.POST,SPHERE_URL,null,newResponse.Listener(){@OverridepublicvoidonResponse(JSONObjectrespo

android - 使用 Volley 发送带有 JSON 数据的 POST 请求

我想发送一个新的JsonObjectRequest请求:我想接收JSON数据(来自服务器的响应):好的我想用这个请求发送JSON格式的数据到服务器JsonObjectRequestrequest=newJsonObjectRequest(Request.Method.POST,"myurl.com",null,newResponse.Listener(){@OverridepublicvoidonResponse(JSONObjectresponse){//...}},newResponse.ErrorListener(){@OverridepublicvoidonErrorRespo

android - 使用 Volley 发送带有 JSON 数据的 POST 请求

我想发送一个新的JsonObjectRequest请求:我想接收JSON数据(来自服务器的响应):好的我想用这个请求发送JSON格式的数据到服务器JsonObjectRequestrequest=newJsonObjectRequest(Request.Method.POST,"myurl.com",null,newResponse.Listener(){@OverridepublicvoidonResponse(JSONObjectresponse){//...}},newResponse.ErrorListener(){@OverridepublicvoidonErrorRespo