hpiaia

LoginRequest

Jun 23rd, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package com.hpiaia.gestorpro;
  2.  
  3. import com.android.volley.Request;
  4. import com.android.volley.Response;
  5. import com.android.volley.toolbox.StringRequest;
  6.  
  7. import java.util.HashMap;
  8. import java.util.Map;
  9.  
  10. public class LoginRequest extends StringRequest {
  11.  
  12.     private static final String REQUEST_URL = "http://hpiaia.com/login";
  13.     private Map<String, String> params;
  14.  
  15.     public LoginRequest(String username, String password, Response.Listener<String> listener, Response.ErrorListener errorListener) {
  16.  
  17.         super(Method.POST, REQUEST_URL, listener, errorListener);
  18.  
  19.         params = new HashMap<>();
  20.         params.put("username", username);
  21.         params.put("password", password);
  22.  
  23.     }
  24.  
  25.     public Map<String, String> getParams() {
  26.         return params;
  27.     }
  28. }
Add Comment
Please, Sign In to add comment