|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.HttpMethodBase | +--org.apache.commons.httpclient.methods.GetMethod | +--org.apache.commons.httpclient.methods.ExpectContinueMethod
This abstract class serves as a foundation for all HTTP methods that support 'Expect: 100-continue' handshake.
The purpose of the 100 (Continue) status (refer to section 10.1.1 of the RFC 2616 for more details) is to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body. In some cases, it might either be inappropriate or highly inefficient for the client to send the body if the server will reject the message without looking at the body.
'Expect: 100-continue' handshake should be used with caution, as it may cause problems with HTTP servers and proxies that do not support HTTP/1.1 protocol.
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase |
USER_AGENT |
Constructor Summary | |
ExpectContinueMethod()
No-arg constructor. |
|
ExpectContinueMethod(java.lang.String uri)
Constructor specifying a URI. |
|
ExpectContinueMethod(java.lang.String uri,
java.lang.String tempDir)
Deprecated. the client is responsible for disk I/O |
|
ExpectContinueMethod(java.lang.String uri,
java.lang.String tempDir,
java.lang.String tempFile)
Deprecated. the client is responsible for disk I/O |
Method Summary | |
protected void |
addRequestHeaders(HttpState state,
HttpConnection conn)
Sets the Expect header if it has not already been set, in addition to the "standard" set of headers. |
boolean |
getUseExpectHeader()
Returns true if the 'Expect: 100-Continue' handshake is activated. |
protected abstract boolean |
hasRequestContent()
Returns true if there is a request body to be sent. |
void |
setUseExpectHeader(boolean value)
Activates 'Expect: 100-Continue' handshake. |
Methods inherited from class org.apache.commons.httpclient.methods.GetMethod |
getFileData,
getName,
getTempDir,
getTempFile,
getUseDisk,
readResponseBody,
recycle,
setFileData,
setTempDir,
setTempFile,
setUseDisk |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ExpectContinueMethod()
public ExpectContinueMethod(java.lang.String uri)
uri
- either an absolute or relative URIpublic ExpectContinueMethod(java.lang.String uri, java.lang.String tempDir)
uri
- either an absolute or relative URItempDir
- directory to store temp files inpublic ExpectContinueMethod(java.lang.String uri, java.lang.String tempDir, java.lang.String tempFile)
uri
- either an absolute or relative URItempDir
- directory to store temp files intempFile
- file to store temporary data inMethod Detail |
public boolean getUseExpectHeader()
Returns true if the 'Expect: 100-Continue' handshake is activated. The purpose of the 'Expect: 100-Continue' handshake to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.
public void setUseExpectHeader(boolean value)
Activates 'Expect: 100-Continue' handshake. The purpose of the 'Expect: 100-Continue' handshake to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.
The use of the 'Expect: 100-continue' handshake can result in noticable peformance improvement for entity enclosing requests (such as POST and PUT) that require the target server's authentication.
'Expect: 100-continue' handshake should be used with caution, as it may cause problems with HTTP servers and proxies that do not support HTTP/1.1 protocol.
value
- boolean valueprotected abstract boolean hasRequestContent()
protected void addRequestHeaders(HttpState state, HttpConnection conn) throws java.io.IOException, HttpException
state
- the state
information associated with this methodconn
- the connection
used to execute
this HTTP method
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |