@@ -0,0 +1,2535 @@
+package org.apache.synapse.transport.http.conn;%0A%0Aimport org.apache.http.HttpRequest;%0Aimport org.apache.http.HttpRequestFactory;%0Aimport org.apache.http.MethodNotSupportedException;%0Aimport org.apache.http.RequestLine;%0Aimport org.apache.http.message.BasicHttpEntityEnclosingRequest;%0Aimport org.apache.http.message.BasicHttpRequest;%0A%0Apublic class SynapseHTTPRequestFactory implements HttpRequestFactory %7B%0A%0A    private static final String%5B%5D RFC2616_COMMON_METHODS = %7B%0A            %22GET%22%0A    %7D;%0A%0A    private static final String%5B%5D RFC2616_ENTITY_ENC_METHODS = %7B%0A            %22POST%22,%0A            %22PUT%22,%0A            %22PATCH%22%0A    %7D;%0A%0A    private static final String%5B%5D RFC2616_SPECIAL_METHODS = %7B%0A            %22HEAD%22,%0A            %22OPTIONS%22,%0A            %22DELETE%22,%0A            %22TRACE%22,%0A            %22CONNECT%22%0A    %7D;%0A%0A%0A    public SynapseHTTPRequestFactory() %7B%0A        super();%0A    %7D%0A%0A    private static boolean isOneOf(final String%5B%5D methods, final String method) %7B%0A        for (int i = 0; i %3C methods.length; i++) %7B%0A            if (methods%5Bi%5D.equalsIgnoreCase(method)) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A    public HttpRequest newHttpRequest(final RequestLine requestline)%0A            throws MethodNotSupportedException %7B%0A        if (requestline == null) %7B%0A            throw new IllegalArgumentException(%22Request line may not be null%22);%0A        %7D%0A        String method = requestline.getMethod();%0A        if (isOneOf(RFC2616_COMMON_METHODS, method)) %7B%0A            return new BasicHttpRequest(requestline);%0A        %7D else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) %7B%0A            return new BasicHttpEntityEnclosingRequest(requestline);%0A        %7D else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) %7B%0A            return new BasicHttpRequest(requestline);%0A        %7D else %7B%0A            throw new MethodNotSupportedException(method +  %22 method not supported%22);%0A        %7D%0A    %7D%0A%0A    public HttpRequest newHttpRequest(final String method, final String uri)%0A            throws MethodNotSupportedException %7B%0A        if (isOneOf(RFC2616_COMMON_METHODS, method)) %7B%0A            return new BasicHttpRequest(method, uri);%0A        %7D else if (isOneOf(RFC2616_ENTITY_ENC_METHODS, method)) %7B%0A            return new BasicHttpEntityEnclosingRequest(method, uri);%0A        %7D else if (isOneOf(RFC2616_SPECIAL_METHODS, method)) %7B%0A            return new BasicHttpRequest(method, uri);%0A        %7D else %7B%0A            throw new MethodNotSupportedException(method%0A                    + %22 method not supported%22);%0A        %7D%0A    %7D%0A%0A%7D

patch transport support