Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. String uri = String.format("http://app.noledo.com/RestServiceImpl.svc/GetIndirizzi");
  2.  
  3. /*HashMap<String, String> params = new HashMap<String, String>();
  4. params.put("userId", cProfile.getId());
  5. params.put("clientGroupId", group_id); //Add the data you'd like to send to the server.*/
  6.  
  7.  
  8. StringRequest sendMessageRequest = new StringRequest(Request.Method.POST, uri,new Response.Listener<String>() {
  9. @Override
  10. public void onResponse(String response) {
  11. VolleyLog.v("Response:%n %s", response);
  12.  
  13.  
  14. }
  15. }, new Response.ErrorListener() {
  16. @Override
  17. public void onErrorResponse(VolleyError error) {
  18. VolleyLog.e("Error: ", error.getMessage());
  19. }
  20. }) {
  21. @Override
  22. public Map<String, String> getHeaders() throws AuthFailureError {
  23. Map<String, String> params = new HashMap<String, String>();
  24.  
  25. return params;
  26. }
  27.  
  28. @Override
  29. public byte[] getBody() throws AuthFailureError {
  30. String body = "";
  31.  
  32. return body.getBytes();
  33. }
  34.  
  35.  
  36. };
  37. MyApplication.getInstance(getActivity()).addToRequestQueue(sendMessageRequest);
  38.  
  39.  
  40. return true;
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement