org.apache.commons.httpclient.methods
Class ExpectContinueMethod

java.lang.Object
  |
  +--org.apache.commons.httpclient.HttpMethodBase
        |
        +--org.apache.commons.httpclient.methods.GetMethod
              |
              +--org.apache.commons.httpclient.methods.ExpectContinueMethod
Direct Known Subclasses:
EntityEnclosingMethod, MultipartPostMethod

public abstract class ExpectContinueMethod
extends GetMethod

This abstract class serves as a foundation for all HTTP methods that support 'Expect: 100-continue' handshake.

'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.

Since:
2.0beta1
Author:
Oleg Kalnichevski

Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Constructor Summary
ExpectContinueMethod()
          No-arg constructor.
ExpectContinueMethod(String uri)
          Constructor specifying a URI.
ExpectContinueMethod(String uri, String tempDir)
          Deprecated. the client is responsible for disk I/O
ExpectContinueMethod(String uri, String tempDir, String tempFile)
          Deprecated. the client is responsible for disk I/O
 
Method Summary
protected  void addRequestHeaders(HttpState state, HttpConnection conn)
          Set the Expect header if it has not already been set, in addition to the "standard" set of headers.
 boolean getUseExpectHeader()
          Returns the useExpectHeader.
protected abstract  boolean hasRequestContent()
          Returns true if there is a request body to be sent.
 void setUseExpectHeader(boolean value)
          Sets the useExpectHeader.
 
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 org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, fakeResponse, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getMethodRetryHandler, getPath, getProxyAuthenticationRealm, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestContentLength, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isHttp11, isStrictMode, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, responseBodyConsumed, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestBody, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpectContinueMethod

public ExpectContinueMethod()
No-arg constructor.
Since:
2.0

ExpectContinueMethod

public ExpectContinueMethod(String uri)
Constructor specifying a URI.
Parameters:
uri - either an absolute or relative URI
Since:
2.0

ExpectContinueMethod

public ExpectContinueMethod(String uri,
                            String tempDir)
Deprecated. the client is responsible for disk I/O

Constructor specifying a URI and a tempDir.
Parameters:
uri - either an absolute or relative URI
tempDir - directory to store temp files in
Since:
2.0

ExpectContinueMethod

public ExpectContinueMethod(String uri,
                            String tempDir,
                            String tempFile)
Deprecated. the client is responsible for disk I/O

Constructor specifying a URI, tempDir and tempFile.
Parameters:
uri - either an absolute or relative URI
tempDir - directory to store temp files in
tempFile - file to store temporary data in
Since:
2.0
Method Detail

getUseExpectHeader

public boolean getUseExpectHeader()
Returns the useExpectHeader.
Returns:
boolean
Since:
2.0beta1

setUseExpectHeader

public void setUseExpectHeader(boolean value)
Sets the useExpectHeader.

'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.

Parameters:
value - The useExpectHeader to set
Since:
2.0beta1

hasRequestContent

protected abstract boolean hasRequestContent()
Returns true if there is a request body to be sent. 'Expect: 100-continue' handshake may not be used if request body is not present
Returns:
boolean
Since:
2.0beta1

addRequestHeaders

protected void addRequestHeaders(HttpState state,
                                 HttpConnection conn)
                          throws IOException,
                                 HttpException
Set the Expect header if it has not already been set, in addition to the "standard" set of headers.
Overrides:
addRequestHeaders in class HttpMethodBase
Parameters:
state - the client state
conn - the connection to write to
Throws:
HttpException - when a protocol error occurs or state is invalid
IOException - when i/o errors occur reading the response


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.