3
如何與Android的凌空MVC的API後method.I上傳圖片曾經嘗試這樣做:如何與Android的凌空MVC的API POST方法上傳圖像
StringRequest stringRequest = new StringRequest(Request.Method.POST, UPLOAD_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String responec) {
loading.dismiss();
Log.e("tag","data :"+responec);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
loading.dismiss();
Log.e("tag","data :"+volleyError.toString());
}
}){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
String image = getStringImage(bitmap);
Map<String,String> params = new Hashtable<String, String>();
params.put(KEY_IMAGE, image);
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
我該怎麼處理這個問題。