FileDocCategorySizeDatePackage
BasicHttpRequest.javaAPI DocAndroid 1.5 API3477Wed May 06 22:41:10 BST 2009org.apache.http.message

BasicHttpRequest

public class BasicHttpRequest extends AbstractHttpMessage implements HttpRequest
Basic implementation of an HTTP request that can be modified.
author
Oleg Kalnichevski
version
$Revision: 573864 $
since
4.0

Fields Summary
private final RequestLine
requestline
private final String
method
private final String
uri
Constructors Summary
public BasicHttpRequest(String method, String uri)

        super();
        if (method == null) {
            throw new IllegalArgumentException("Method name may not be null");
        }
        if (uri == null) {
            throw new IllegalArgumentException("Request URI may not be null");
        }
        this.method = method;
        this.uri = uri;
        this.requestline = null;
    
public BasicHttpRequest(String method, String uri, ProtocolVersion ver)

        this(new BasicRequestLine(method, uri, ver));
    
public BasicHttpRequest(RequestLine requestline)

        super();
        if (requestline == null) {
            throw new IllegalArgumentException("Request line may not be null");
        }
        this.requestline = requestline;
        this.method = requestline.getMethod();
        this.uri = requestline.getUri();
    
Methods Summary
public org.apache.http.ProtocolVersiongetProtocolVersion()

        if (this.requestline != null) {
            return this.requestline.getProtocolVersion();
        } else {
            return HttpProtocolParams.getVersion(getParams());
        }
    
public org.apache.http.RequestLinegetRequestLine()

        if (this.requestline != null) {
            return this.requestline;
        } else {
            ProtocolVersion ver = HttpProtocolParams.getVersion(getParams());
            return new BasicRequestLine(this.method, this.uri, ver);
        }