Java 如何使用截击post请求
我将使用截击来获取数据Java 如何使用截击post请求,java,android,mobile,android-volley,Java,Android,Mobile,Android Volley,我将使用截击来获取数据 RequestQueue queue = Volley.newRequestQueue(SummaryPhoneActivity.this); String url = "https://covid19storageservice.table.core.windows.net/COVID19Survey?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-06-30T18:04:08Z
RequestQueue queue = Volley.newRequestQueue(SummaryPhoneActivity.this);
String url = "https://covid19storageservice.table.core.windows.net/COVID19Survey?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-06-30T18:04:08Z&st=2020-03-30T10:04:08Z&spr=https&sig=Ei3Kcr6xT5e7znK4ebwx6%2FVS09Ia5pbD1lnWRBh6bm4%3D";
StringRequest stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d("response:", response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("error:", error.toString());
}
}){
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("Content-Type", "application/json");
return params;
}
};
queue.add(stringRequest);
RequestQueue queue=Volley.newRequestQueue(SummaryPhoneActivity.this);
字符串url=”https://covid19storageservice.table.core.windows.net/COVID19Survey?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2020-06-30T18:04:08Z&st=2020-03-30T10:04:08Z&spr=https&sig=Ei3Kcr6xT5e7znK4ebwx6%2FWS09IA5PBD1NWRBH6BM4%3D”;
StringRequest StringRequest=新建StringRequest(Request.Method.GET,url,new Response.Listener()){
@凌驾
公共void onResponse(字符串响应){
Log.d(“响应:”,响应);
}
},new Response.ErrorListener(){
@凌驾
公共无效onErrorResponse(截击错误){
Log.d(“error:,error.toString());
}
}){
@凌驾
公共映射getHeaders()引发AuthFailureError{
Map params=新的HashMap();
参数put(“内容类型”、“应用程序/json”);
返回参数;
}
};
添加(stringRequest);
我可以得到错误:com.android.volley.ClientError。
上面的url是关于邮递员的。
在上述情况下,我如何使用截击。谢谢你的进步