I have simple question which method to call on POST and which method to call on GET.
This is my simple Class:
public class CustomStringRequest extends Request<CustomNetworkResponse> {
private final Map<String, String> headers;
private final Map<String, String> params;
private final String body;
private final Response.Listener<CustomNetworkResponse> listener;
public CustomStringRequest(int method,
String url,
Map<String, String> headers,
Map<String, String> params,
String body,
Response.Listener<CustomNetworkResponse> listener,
Response.ErrorListener errorListener) {
super(method, url, errorListener);
this.headers = headers;
this.params = params;
this.body = body;
this.listener = listener;
}
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
return headers != null ? headers : super.getHeaders();
}
@Override
public Map<String, String> getParams() {
return params;
}
@Override
public byte[] getBody() throws AuthFailureError {
return body != null ? body.getBytes() : null;
}
How can I use getParams() and getBody() at the same time? Is it possible, because when I check the super implementation I assume it's impossible.
I also commented out the method getBody() to see thats true.
Does that mean that i can't send POST with body and also url parameters? Are url parameters meant to be used for GET request?? Is this standard?