2016-03-15 23 views

回答

-1

用乱射后,并得到发送一个简单的要求: -

enter link description here

或者,你可以在这里看到的例子: -

StringRequest stringRequest = new StringRequest(Request.Method.POST, url, 
        new Response.Listener<String>() { 
         @Override 
         public void onResponse(String response) { 

          returnValue = response; 
          try { 
           parseFromUrl(response); 
           System.out.println(returnValue); 
          } catch (JSONException e) { 
           e.printStackTrace(); 
          } catch (Exception e) { 
           e.printStackTrace(); 
          } 

         } 
        }, 
        new Response.ErrorListener() { 
         @Override 
         public void onErrorResponse(VolleyError error) { 
          Toast.makeText(app,error.toString(),Toast.LENGTH_SHORT).show(); 

         } 
        }) { 
       @Override 
       protected Map<String, String> getParams() { 
        Map<String, String> params = new HashMap<String, String>(); 
        params.put("Password", password); 
        params.put("RememberMe", "false"); 
        params.put("ReturnUrl", url_post); 
        params.put("UserName",username); 
        params.put(name,_RequestVerificationToken); 
        return params; 
       } 

      }; 

      RequestQueue requestQueue = Volley.newRequestQueue(app); 
      requestQueue.add(stringRequest); 
+0

这不会发送整数或图像作为问题要求 –

相关问题