Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.kristofa.test.http;

A HttpResponseProvider that supports http request with all properties. It supports any http header you define as opposed to SimpleHttpResponseProvider which only supports Content-Type.

 public class DefaultHttpResponseProvider extends AbstractHttpResponseProvider {

Creates a new instance.

ignoreAdditionalHeaders In some cases you might want to ignore additional http headers and only want to check some headers. For example sometimes a HTTP client adds custom identification headers you might not be interested in. If this is the case and you don't necessary want a full match then specific true. In case you specify false all http headers will be matched.
    public DefaultHttpResponseProvider(final boolean ignoreAdditionalHeaders) {
        if (ignoreAdditionalHeaders) {

Sets a new request/response.

request HttpRequest.
response Response that should be returned for given request.
    public void set(final HttpRequest requestfinal HttpResponse response) {
        addExpected(requestnew DefaultHttpResponseProxy(response));
Reset the response provider to its original state
    public void reset() {
New to GrepCode? Check out our FAQ X