FileDocCategorySizeDatePackage
MockHttpStack.javaAPI DocAndroid 5.1 API2046Thu Mar 12 22:22:56 GMT 2015com.android.volley.mock

MockHttpStack

public class MockHttpStack extends Object implements com.android.volley.toolbox.HttpStack

Fields Summary
private HttpResponse
mResponseToReturn
private String
mLastUrl
private Map
mLastHeaders
private byte[]
mLastPostBody
Constructors Summary
Methods Summary
public java.util.MapgetLastHeaders()

        return mLastHeaders;
    
public byte[]getLastPostBody()

        return mLastPostBody;
    
public java.lang.StringgetLastUrl()

        return mLastUrl;
    
public org.apache.http.HttpResponseperformRequest(com.android.volley.Request request, java.util.Map additionalHeaders)

        mLastUrl = request.getUrl();
        mLastHeaders = new HashMap<String, String>();
        if (request.getHeaders() != null) {
            mLastHeaders.putAll(request.getHeaders());
        }
        if (additionalHeaders != null) {
            mLastHeaders.putAll(additionalHeaders);
        }
        try {
            mLastPostBody = request.getBody();
        } catch (AuthFailureError e) {
            mLastPostBody = null;
        }
        return mResponseToReturn;
    
public voidsetResponseToReturn(org.apache.http.HttpResponse response)

        mResponseToReturn = response;