@NotThreadSafe public class HTTPMethod extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HTTPMethod.RetryHandler |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
| Constructor and Description |
|---|
HTTPMethod(ucar.nc2.util.net.HTTPSession.Methods m,
HTTPSession session,
String url)
It is possible to specify a url when invoking, for example, HTTPMethod.Get.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHoldContent() |
void |
close() |
void |
consumeContent() |
int |
execute() |
static HTTPMethod |
Get(HTTPSession session) |
static HTTPMethod |
Get(HTTPSession session,
String legalurl) |
static Enumeration |
getAllowedMethods() |
String |
getCharSet() |
org.apache.commons.httpclient.HttpState |
getContext() |
String |
getEffectiveVersion() |
org.apache.commons.httpclient.HttpMethodBase |
getMethod() |
Object |
getMethodParameter(String key) |
org.apache.commons.httpclient.params.HttpMethodParams |
getMethodParameters() |
String |
getName() |
String |
getPath() |
String |
getProtocolVersion() |
org.apache.commons.httpclient.Header |
getRequestHeader(String name) |
org.apache.commons.httpclient.Header[] |
getRequestHeaders() |
String |
getRequestLine() |
byte[] |
getResponseAsBytes() |
byte[] |
getResponseAsBytes(int maxsize) |
InputStream |
getResponseAsStream() |
String |
getResponseAsString() |
String |
getResponseAsString(String charset) |
InputStream |
getResponseBodyAsStream() |
String |
getResponseCharSet() |
org.apache.commons.httpclient.Header[] |
getResponseFooters() |
org.apache.commons.httpclient.Header |
getResponseHeader(String name) |
org.apache.commons.httpclient.Header |
getResponseHeaderdmh(String name) |
org.apache.commons.httpclient.Header[] |
getResponseHeaders() |
Object |
getResponseParameter(String name) |
HTTPSession |
getSession() |
String |
getSoTimeout() |
int |
getStatusCode() |
String |
getStatusLine() |
String |
getStatusText() |
String |
getURL() |
String |
getVirtualHost() |
static HTTPMethod |
Head(HTTPSession session) |
static HTTPMethod |
Head(HTTPSession session,
String legalurl) |
static HTTPMethod |
Options(HTTPSession session) |
static HTTPMethod |
Options(HTTPSession session,
String legalurl) |
static HTTPMethod |
Post(HTTPSession session) |
static HTTPMethod |
Post(HTTPSession session,
String legalurl) |
static HTTPMethod |
Put(HTTPSession session) |
static HTTPMethod |
Put(HTTPSession session,
String legalurl) |
void |
setContext(org.apache.commons.httpclient.HttpState cxt) |
void |
setFollowRedirects(boolean tf) |
static void |
setGlobalParameter(String name,
Object value) |
void |
setMethodHeaders(List<org.apache.commons.httpclient.Header> headers) |
void |
setMultipartRequest(org.apache.commons.httpclient.methods.multipart.Part[] parts) |
void |
setRequestContentAsString(String content) |
void |
setRequestHeader(org.apache.commons.httpclient.Header h) |
void |
setRequestHeader(String name,
String value) |
void |
setRequestParameter(String name,
Object value) |
public HTTPMethod(ucar.nc2.util.net.HTTPSession.Methods m,
HTTPSession session,
String url)
throws HTTPException
HTTPExceptionpublic static HTTPMethod Get(HTTPSession session) throws HTTPException
HTTPExceptionpublic static HTTPMethod Head(HTTPSession session) throws HTTPException
HTTPExceptionpublic static HTTPMethod Put(HTTPSession session) throws HTTPException
HTTPExceptionpublic static HTTPMethod Post(HTTPSession session) throws HTTPException
HTTPExceptionpublic static HTTPMethod Options(HTTPSession session) throws HTTPException
HTTPExceptionpublic static HTTPMethod Get(HTTPSession session, String legalurl) throws HTTPException
HTTPExceptionpublic static HTTPMethod Head(HTTPSession session, String legalurl) throws HTTPException
HTTPExceptionpublic static HTTPMethod Put(HTTPSession session, String legalurl) throws HTTPException
HTTPExceptionpublic static HTTPMethod Post(HTTPSession session, String legalurl) throws HTTPException
HTTPExceptionpublic static HTTPMethod Options(HTTPSession session, String legalurl) throws HTTPException
HTTPExceptionpublic int execute()
throws HTTPException
HTTPExceptionpublic void close()
public void consumeContent()
public void setContext(org.apache.commons.httpclient.HttpState cxt)
public org.apache.commons.httpclient.HttpState getContext()
public int getStatusCode()
public String getStatusLine()
public String getRequestLine()
public String getPath()
public boolean canHoldContent()
public InputStream getResponseBodyAsStream()
public InputStream getResponseAsStream()
public byte[] getResponseAsBytes(int maxsize)
public byte[] getResponseAsBytes()
public String getResponseAsString()
public void setMethodHeaders(List<org.apache.commons.httpclient.Header> headers) throws HTTPException
HTTPExceptionpublic void setRequestHeader(String name, String value) throws HTTPException
HTTPExceptionpublic void setRequestHeader(org.apache.commons.httpclient.Header h)
throws HTTPException
HTTPExceptionpublic org.apache.commons.httpclient.Header getRequestHeader(String name)
public org.apache.commons.httpclient.Header[] getRequestHeaders()
public org.apache.commons.httpclient.Header getResponseHeader(String name)
public org.apache.commons.httpclient.Header getResponseHeaderdmh(String name)
public org.apache.commons.httpclient.Header[] getResponseHeaders()
public org.apache.commons.httpclient.Header[] getResponseFooters()
public org.apache.commons.httpclient.params.HttpMethodParams getMethodParameters()
public void setRequestContentAsString(String content) throws HTTPException
HTTPExceptionpublic void setMultipartRequest(org.apache.commons.httpclient.methods.multipart.Part[] parts)
throws HTTPException
HTTPExceptionpublic String getCharSet()
public String getName()
public String getURL()
public String getEffectiveVersion()
public String getProtocolVersion()
public String getSoTimeout()
public String getVirtualHost()
public String getStatusText()
public static Enumeration getAllowedMethods()
public void setFollowRedirects(boolean tf)
public String getResponseCharSet()
public HTTPSession getSession()
public org.apache.commons.httpclient.HttpMethodBase getMethod()
Copyright © 1999-2012 UCAR/Unidata. All Rights Reserved.