package com.droidutils.http.builder;

import com.droidutils.jsonparser.JsonConverter;

import java.util.List;
import java.util.Map;

/**
 * Created by Mkhitar on 25.09.2014.
 */
public class HttpResponse<T> {

    private String mResponseBody;
    private Map<String, List<String>> mResponseHeaders;
    private Class<T> mResponseType;

    public HttpResponse(String responseBody, Map<String, List<String>> responseHeaders, Class<T> responseType) {
        mResponseBody = responseBody;
        mResponseHeaders = responseHeaders;
        mResponseType = responseType;
    }

    public T getBody() throws Exception {

        return new JsonConverter().readJson(mResponseBody, mResponseType);
    }

    public String getBodyToString(){
        return mResponseBody;
    }

    public Map<String, List<String>> getHeaders(){
        return mResponseHeaders;
    }
}

@@ -858,11 +858,108 @@
 s;%0A    %7D
+%0A%0A    public String getHeader(String key)%7B%0A        return mResponseHeaders.get(key).get(0);%0A    %7D
 %0A%7D%0A

add getHeader method