// Copyright 2014, Kevin Ko <kevin@faveset.com>

package com.faveset.khttp;

class HttpRequest {
    public enum Method {
        OPTIONS,
        GET,
        HEAD,
        POST,
        PUT,
        DELETE,
        TRACE,
        CONNECT
    }

    private Method mMethod;

    private String mUri;

    public HttpRequest() {}

    public Method getMethod() {
        return mMethod;
    }

    public String getUri() {
        return mUri;
    }

    public void setMethod(Method method) {
        mMethod = method;
    }

    public void setUri(String uri) {
        mUri = uri;
    }
}

@@ -70,16 +70,94 @@
 khttp;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0A%0A
 class Ht
@@ -382,143 +382,1722 @@
    p
-ublic HttpRequest() %7B%7D%0A%0A    public Method getMethod() %7B%0A        return mMethod;%0A    %7D%0A%0A    public String getUri() %7B%0A        return mUri
+rivate HashMap%3CString, List%3CString%3E%3E mHeaders;%0A%0A    public HttpRequest() %7B%0A        mHeaders = new HashMap%3CString, List%3CString%3E%3E();%0A    %7D%0A%0A    /**%0A     * Appends value to the mapping list for name, creating a mapping if%0A     * necessary.%0A     */%0A    public void appendHeader(String name, String value) %7B%0A        List%3CString%3E l = mHeaders.get(name);%0A        if (l == null) %7B%0A            l = new ArrayList%3CString%3E();%0A            mHeaders.put(name, l);%0A        %7D%0A%0A        l.add(value);%0A    %7D%0A%0A    public void clearHeaders() %7B%0A        mHeaders.clear();%0A    %7D%0A%0A    /**%0A     * @return The list of values for the header named name or null if it%0A     * doesn't exist.  The returned list will always have non-zero length.%0A     */%0A    public List%3CString%3E getHeader(String name) %7B%0A        return mHeaders.get(name);%0A    %7D%0A%0A    /**%0A     * Convenience method for returning the first header value or null if no%0A     * mapping exists.%0A     */%0A    public String getHeaderFirst(String name) %7B%0A        List%3CString%3E l = mHeaders.get(name);%0A        if (l == null) %7B%0A            return null;%0A        %7D%0A        return l.get(0);%0A    %7D%0A%0A    public Method getMethod() %7B%0A        return mMethod;%0A    %7D%0A%0A    public String getUri() %7B%0A        return mUri;%0A    %7D%0A%0A    /**%0A     * Assigns value to the mapping for name.  This clears any existing list%0A     * values.%0A     */%0A    public void setHeader(String name, String value) %7B%0A        List%3CString%3E l = new ArrayList%3CString%3E();%0A        l.add(value);%0A%0A        mHeaders.put(name, l);%0A    %7D%0A%0A    /**%0A     * Assigns value to the mapping for name.  This overwrites any existing%0A     * mapping.%0A     */%0A    public void setHeaderList(String name, List%3CString%3E values) %7B%0A        mHeaders.put(name, values)
 ;%0A  

Add header storage and manipulation methods.