Class Continue
- All Implemented Interfaces:
HttpMessage
,HttpResponse
The server has received the request headers and the client should proceed to send the request body (in the case of a request for which a body needs to be sent; for example, a POST request). Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient. To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request and receive a 100 Continue status code in response before sending the body. If the client receives an error code such as 403 (Forbidden) or 405 (Method Not Allowed) then it shouldn't send the request's body. The response 417 Expectation Failed indicates that the request should be repeated without the Expect header as it indicates that the server doesn't support expectations (this is the case, for example, of HTTP/1.0 servers).
See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionContinue()
Constructor.Continue
(HttpResponse response) Constructor.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a builder for this class initialized with the contents of this bean.setContent
(String value) Sets the body on this response.setContent
(HttpEntity value) Sets the body on this response.setHeader2
(String name, String value) Sets the specified header to the end of the headers in this builder.setHeader2
(Header value) Sets the specified header to the end of the headers in this builder.setHeaders
(List<Header> values) Sets the specified headers to the end of the headers in this builder.setHeaders
(HeaderList value) Sets the specified headers on this response.setHeaders2
(Header... values) Sets the specified headers to the end of the headers in this builder.setLocale2
(Locale value) Sets the locale used to retrieve reason phrases.setLocation
(String value) Specifies the value for theLocation header.setLocation
(URI value) Specifies the value for theLocation header.Sets the protocol version on the status line.setReasonPhrase2
(String value) Sets the reason phrase on the status line.Sets the reason phrase catalog used to retrieve reason phrases.setStatusCode2
(int value) Sets the status code on the status line.setStatusLine
(BasicStatusLine value) Sets the protocol version on the status line.Specifies whether this bean should be unmodifiable.Methods inherited from class org.apache.juneau.http.response.BasicHttpResponse
addHeader, addHeader, assertModifiable, assertStatusCode, containsHeader, getAllHeaders, getEntity, getFirstHeader, getHeaders, getHeaders, getLastHeader, getLocale, getParams, getProtocolVersion, getStatusLine, headerIterator, headerIterator, isUnmodifiable, removeHeader, removeHeaders, setEntity, setHeader, setHeader, setHeaders, setLocale, setParams, setReasonPhrase, setStatusCode, setStatusLine, setStatusLine, setStatusLine, toString
-
Field Details
-
STATUS_CODE
HTTP status code- See Also:
-
REASON_PHRASE
Reason phrase- See Also:
-
INSTANCE
Default unmodifiable instance
-
-
Constructor Details
-
Continue
public Continue()Constructor. -
Continue
Copy constructor.- Parameters:
copyFrom
- The bean to copy from.
-
Continue
Constructor.This is the constructor used when parsing an HTTP response.
- Parameters:
response
- The HTTP response to copy from. Must not benull .- Throws:
AssertionError
- If HTTP response status code does not match what was expected.
-
-
Method Details
-
copy
Creates a builder for this class initialized with the contents of this bean.- Returns:
- A new builder bean.
-
setContent
Description copied from class:BasicHttpResponse
Sets the body on this response.- Overrides:
setContent
in classBasicHttpResponse
- Parameters:
value
- The body on this response.- Returns:
- This object.
-
setContent
Description copied from class:BasicHttpResponse
Sets the body on this response.- Overrides:
setContent
in classBasicHttpResponse
- Parameters:
value
- The body on this response.- Returns:
- This object.
-
setHeader2
Description copied from class:BasicHttpResponse
Sets the specified header to the end of the headers in this builder.- Overrides:
setHeader2
in classBasicHttpResponse
- Parameters:
value
- The header to add.null values are ignored.- Returns:
- This object.
-
setHeader2
Description copied from class:BasicHttpResponse
Sets the specified header to the end of the headers in this builder.- Overrides:
setHeader2
in classBasicHttpResponse
- Parameters:
name
- The header name.value
- The header value.- Returns:
- This object.
-
setHeaders
Description copied from class:BasicHttpResponse
Sets the specified headers to the end of the headers in this builder.- Overrides:
setHeaders
in classBasicHttpResponse
- Parameters:
values
- The headers to add.null values are ignored.- Returns:
- This object.
-
setHeaders
Description copied from class:BasicHttpResponse
Sets the specified headers on this response.- Overrides:
setHeaders
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setHeaders2
Description copied from class:BasicHttpResponse
Sets the specified headers to the end of the headers in this builder.- Overrides:
setHeaders2
in classBasicHttpResponse
- Parameters:
values
- The headers to add.null values are ignored.- Returns:
- This object.
-
setLocale2
Description copied from class:BasicHttpResponse
Sets the locale used to retrieve reason phrases.If not specified, uses
Locale.getDefault()
.- Overrides:
setLocale2
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setLocation
Description copied from class:BasicHttpResponse
Specifies the value for theLocation header.- Overrides:
setLocation
in classBasicHttpResponse
- Parameters:
value
- The new header location.- Returns:
- This object.
-
setLocation
Description copied from class:BasicHttpResponse
Specifies the value for theLocation header.- Overrides:
setLocation
in classBasicHttpResponse
- Parameters:
value
- The new header location.- Returns:
- This object.
-
setProtocolVersion
Description copied from class:BasicHttpResponse
Sets the protocol version on the status line.If not specified,
"HTTP/1.1" will be used.- Overrides:
setProtocolVersion
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setReasonPhrase2
Description copied from class:BasicHttpResponse
Sets the reason phrase on the status line.If not specified, the reason phrase will be retrieved from the reason phrase catalog using the locale on this builder.
- Overrides:
setReasonPhrase2
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setReasonPhraseCatalog
Description copied from class:BasicHttpResponse
Sets the reason phrase catalog used to retrieve reason phrases.If not specified, uses
EnglishReasonPhraseCatalog
.- Overrides:
setReasonPhraseCatalog
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setStatusCode2
Description copied from class:BasicHttpResponse
Sets the status code on the status line.If not specified,
0 will be used.- Overrides:
setStatusCode2
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setStatusLine
Description copied from class:BasicHttpResponse
Sets the protocol version on the status line.If not specified,
"HTTP/1.1" will be used.- Overrides:
setStatusLine
in classBasicHttpResponse
- Parameters:
value
- The new value.- Returns:
- This object.
-
setUnmodifiable
Description copied from class:BasicHttpResponse
Specifies whether this bean should be unmodifiable.When enabled, attempting to set any properties on this bean will cause an
UnsupportedOperationException
.- Overrides:
setUnmodifiable
in classBasicHttpResponse
- Returns:
- This object.
-