Constructor and Description |
---|
MockHttpStack() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getLastHeaders() |
byte[] |
getLastPostBody() |
String |
getLastUrl() |
HttpResponse |
performRequest(Request<?> request,
Map<String,String> additionalHeaders)
Performs an HTTP request with the given parameters.
|
void |
setResponseToReturn(HttpResponse response) |
public String getLastUrl()
public byte[] getLastPostBody()
public void setResponseToReturn(HttpResponse response)
public HttpResponse performRequest(Request<?> request, Map<String,String> additionalHeaders) throws AuthFailureError
HttpStack
A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().
performRequest
in interface HttpStack
request
- the request to performadditionalHeaders
- additional headers to be sent together with
Request.getHeaders()
AuthFailureError