Package org.apache.juneau.rest.httppart
Class RequestHeader
java.lang.Object
org.apache.juneau.rest.httppart.RequestHttpPart
org.apache.juneau.rest.httppart.RequestHeader
- All Implemented Interfaces:
Header
,NameValuePair
Represents a single header on an HTTP request.
Typically accessed through the RequestHeaders
class.
Some important methods on this class are:
RequestHeader
- Methods for retrieving simple string values:
- Methods for retrieving as other common types:
asBoolean()
asBooleanHeader()
asCsvArray()
asCsvArrayHeader()
asDate()
asDateHeader()
asEntityTagArrayHeader()
asEntityTagHeader()
asInteger()
asIntegerHeader()
asLong()
asLongHeader()
asMatcher(Pattern)
asMatcher(String)
asMatcher(String,int)
asStringHeader()
asStringRangeArrayHeader()
asUriHeader()
- Methods for retrieving as custom types:
- Methods for performing assertion checks:
- Other methods:
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of this header as aBasicBooleanHeader
.Returns the value of this header as aBasicCsvHeader
.Returns the value of this header as aBasicDateHeader
.Returns the value of this header as aBasicEntityTagHeader
.Returns the value of this header as aBasicEntityTagsHeader
.Returns the value of this header as aBasicIntegerHeader
.Returns the value of this header as aBasicLongHeader
.Returns the value of this header as aBasicStringHeader
.Returns the value of this header as aBasicStringRangesHeader
.Returns the value of this header as aBasicUriHeader
.Parses the value.parser
(HttpPartParserSession value) Specifies the part parser to use for this part.schema
(HttpPartSchema value) Specifies the part schema for this part.toString()
Methods inherited from class org.apache.juneau.rest.httppart.RequestHttpPart
as, as, as, asBoolean, asBooleanPart, asCsvArray, asCsvArrayPart, asDate, asDatePart, asInteger, asIntegerPart, asLong, asLongPart, asMatcher, asMatcher, asMatcher, assertCsvArray, assertDate, assertInteger, assertLong, assertString, asString, asStringPart, asUriPart, def, get, getName, getRequest, getValue, isPresent, orElse
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.http.NameValuePair
getName, getValue
-
Constructor Details
-
RequestHeader
Constructor.- Parameters:
request
- The request object.name
- The header name.value
- The header value.
-
-
Method Details
-
asCsvHeader
Returns the value of this header as aBasicCsvHeader
.- Returns:
- The value of this header as a
BasicCsvHeader
, nevernull .
-
asDateHeader
Returns the value of this header as aBasicDateHeader
.- Returns:
- The value of this header as a
BasicDateHeader
, nevernull .
-
asEntityTagsHeader
Returns the value of this header as aBasicEntityTagsHeader
.- Returns:
- The value of this header as a
BasicEntityTagsHeader
, nevernull .
-
asEntityTagHeader
Returns the value of this header as aBasicEntityTagHeader
.- Returns:
- The value of this header as a
BasicEntityTagHeader
, nevernull .
-
asIntegerHeader
Returns the value of this header as aBasicIntegerHeader
.- Returns:
- The value of this header as a
BasicIntegerHeader
, nevernull .
-
asBooleanHeader
Returns the value of this header as aBasicBooleanHeader
.- Returns:
- The value of this header as a
BasicBooleanHeader
, nevernull .
-
asLongHeader
Returns the value of this header as aBasicLongHeader
.- Returns:
- The value of this header as a
BasicLongHeader
, nevernull .
-
asStringRangesHeader
Returns the value of this header as aBasicStringRangesHeader
.- Returns:
- The value of this header as a
BasicStringRangesHeader
, nevernull .
-
asStringHeader
Returns the value of this header as aBasicStringHeader
.- Returns:
- The value of this header as a
BasicStringHeader
, nevernull .
-
asUriHeader
Returns the value of this header as aBasicUriHeader
.- Returns:
- The value of this header as a
BasicUriHeader
, nevernull .
-
getElements
Parses the value.- Specified by:
getElements
in interfaceHeader
- Returns:
- An array of
HeaderElement
entries, may be empty, but is nevernull . - Throws:
BasicHttpException
- In case of a parsing error.
-
toString
- Overrides:
toString
in classRequestHttpPart
-
schema
Description copied from class:RequestHttpPart
Specifies the part schema for this part.Used by schema-based part parsers such as
OpenApiParser
.- Overrides:
schema
in classRequestHttpPart
- Parameters:
value
- The part schema.- Returns:
- This object.
-
parser
Description copied from class:RequestHttpPart
Specifies the part parser to use for this part.If not specified, uses the part parser defined on the client by calling
RestContext.Builder.partParser()
.- Overrides:
parser
in classRequestHttpPart
- Parameters:
value
- The new part parser to use for this part.
Ifnull ,SimplePartParser.DEFAULT
will be used.- Returns:
- This object.
-