Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SelectUserAuthRequest extends MarthaRequest {
- private String mUsername;
- private String mPassword;
- public SelectUserAuthRequest(String username, String password, Response.Listener<String> listener, Response.ErrorListener errorListener) {
- super("select-user-auth", listener, errorListener);
- mUsername = username;
- mPassword = password;
- }
- @Override
- public byte[] getBody() {
- byte[] body = new byte[0];
- try {
- HashMap h = new HashMap<String, String>();
- h.put("username", mUsername);
- h.put("password", mPassword);
- Gson gson = new Gson();
- String str = gson.toJson(h);
- body = str.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) { /* nothing to do */}
- return body;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement