public class HTTPMethod
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected org.apache.http.HttpEntity |
content |
protected java.util.List<org.apache.http.Header> |
headers |
protected java.lang.String |
legalurl |
protected boolean |
localsession |
protected ucar.httpservices.HTTPSession.Methods |
methodclass |
protected HTTPMethodStream |
methodstream |
protected org.apache.http.client.methods.HttpRequestBase |
request |
protected org.apache.http.HttpResponse |
response |
protected HTTPSession |
session |
| Constructor and Description |
|---|
HTTPMethod(ucar.httpservices.HTTPSession.Methods m) |
HTTPMethod(ucar.httpservices.HTTPSession.Methods m,
HTTPSession session,
java.lang.String url) |
HTTPMethod(ucar.httpservices.HTTPSession.Methods m,
java.lang.String url) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHoldContent() |
void |
close()
Calling close will force the method to close, and will
force any open stream to terminate.
|
protected static boolean |
compatibleURL(java.lang.String u1,
java.lang.String u2)
Define URI compatibility.
|
protected void |
configure(org.apache.http.client.methods.HttpRequestBase request) |
protected org.apache.http.client.methods.HttpRequestBase |
createRequest() |
org.apache.http.HttpMessage |
debugRequest() |
org.apache.http.HttpResponse |
debugResponse() |
int |
execute() |
static java.util.Set<java.lang.String> |
getAllowedMethods() |
java.lang.String |
getCharSet() |
java.lang.String |
getName() |
java.lang.String |
getPath() |
java.lang.String |
getProtocolVersion() |
org.apache.http.Header |
getRequestHeader(java.lang.String name) |
org.apache.http.Header[] |
getRequestHeaders() |
java.lang.String |
getRequestLine() |
byte[] |
getResponseAsBytes() |
byte[] |
getResponseAsBytes(int maxbytes) |
java.io.InputStream |
getResponseAsStream() |
java.lang.String |
getResponseAsString() |
java.lang.String |
getResponseAsString(java.lang.String charset) |
java.io.InputStream |
getResponseBodyAsStream() |
java.lang.String |
getResponseCharSet() |
org.apache.http.Header |
getResponseHeader(java.lang.String name) |
org.apache.http.Header[] |
getResponseHeaders() |
HTTPSession |
getSession() |
java.lang.String |
getSoTimeout() |
int |
getStatusCode() |
java.lang.String |
getStatusLine() |
java.lang.String |
getStatusText() |
java.lang.String |
getURL() |
boolean |
hasStreamOpen() |
boolean |
isClosed() |
boolean |
isSessionLocal() |
protected boolean |
sessionCompatible(java.lang.String other)
Test that the given url is "compatible" with the
session specified dataset.
|
protected org.apache.http.auth.AuthScope |
setAuthentication()
Handle authentication.
|
protected void |
setcontent(org.apache.http.client.methods.HttpRequestBase request) |
void |
setFollowRedirects(boolean tf) |
void |
setMethodHeaders(java.util.List<org.apache.http.Header> headers) |
void |
setRequestContent(org.apache.http.HttpEntity content) |
void |
setRequestHeader(org.apache.http.Header h) |
void |
setRequestHeader(java.lang.String name,
java.lang.String value) |
protected HTTPSession session
protected boolean localsession
protected java.lang.String legalurl
protected java.util.List<org.apache.http.Header> headers
protected org.apache.http.HttpEntity content
protected ucar.httpservices.HTTPSession.Methods methodclass
protected HTTPMethodStream methodstream
protected boolean closed
protected org.apache.http.client.methods.HttpRequestBase request
protected org.apache.http.HttpResponse response
public HTTPMethod(ucar.httpservices.HTTPSession.Methods m)
throws HTTPException
HTTPExceptionpublic HTTPMethod(ucar.httpservices.HTTPSession.Methods m,
java.lang.String url)
throws HTTPException
HTTPExceptionpublic HTTPMethod(ucar.httpservices.HTTPSession.Methods m,
HTTPSession session,
java.lang.String url)
throws HTTPException
HTTPExceptionprotected org.apache.http.client.methods.HttpRequestBase createRequest()
throws HTTPException
HTTPExceptionprotected void setcontent(org.apache.http.client.methods.HttpRequestBase request)
public int execute()
throws HTTPException
HTTPExceptionprotected void configure(org.apache.http.client.methods.HttpRequestBase request)
throws HTTPException
HTTPExceptionpublic void close()
close in interface java.lang.AutoCloseablepublic int getStatusCode()
public java.lang.String getStatusLine()
public java.lang.String getRequestLine()
public java.lang.String getPath()
public boolean canHoldContent()
public java.io.InputStream getResponseBodyAsStream()
public java.io.InputStream getResponseAsStream()
public byte[] getResponseAsBytes(int maxbytes)
public byte[] getResponseAsBytes()
public java.lang.String getResponseAsString(java.lang.String charset)
public java.lang.String getResponseAsString()
public void setMethodHeaders(java.util.List<org.apache.http.Header> headers)
throws HTTPException
HTTPExceptionpublic void setRequestHeader(java.lang.String name,
java.lang.String value)
throws HTTPException
HTTPExceptionpublic void setRequestHeader(org.apache.http.Header h)
throws HTTPException
HTTPExceptionpublic org.apache.http.Header getRequestHeader(java.lang.String name)
public org.apache.http.Header[] getRequestHeaders()
public org.apache.http.Header getResponseHeader(java.lang.String name)
public org.apache.http.Header[] getResponseHeaders()
public void setRequestContent(org.apache.http.HttpEntity content)
public java.lang.String getCharSet()
public java.lang.String getName()
public java.lang.String getURL()
public java.lang.String getProtocolVersion()
public java.lang.String getSoTimeout()
public java.lang.String getStatusText()
public static java.util.Set<java.lang.String> getAllowedMethods()
public void setFollowRedirects(boolean tf)
public java.lang.String getResponseCharSet()
public HTTPSession getSession()
public boolean isSessionLocal()
public boolean hasStreamOpen()
public boolean isClosed()
protected boolean sessionCompatible(java.lang.String other)
protected org.apache.http.auth.AuthScope setAuthentication()
throws HTTPException
HTTPExceptionprotected static boolean compatibleURL(java.lang.String u1,
java.lang.String u2)
public org.apache.http.HttpMessage debugRequest()
public org.apache.http.HttpResponse debugResponse()