Package org.apache.http
Interface HeaderElement
-
- All Known Implementing Classes:
BasicHeaderElement
public interface HeaderElement
One element of an HTTPheader
value consisting of a name / value pair and a number of optional name / value parameters.Some HTTP headers (such as the set-cookie header) have values that can be decomposed into multiple elements. Such headers must be in the following form:
header = [ element ] *( "," [ element ] ) element = name [ "=" [ value ] ] *( ";" [ param ] ) param = name [ "=" [ value ] ] name = token value = ( token | quoted-string ) token = 1*<any char except "=", ",", ";", <"> and white space> quoted-string = <"> *( text | quoted-char ) <"> text = any char except <"> quoted-char = "\" char
Any amount of white space is allowed between any part of the header, element or param and is ignored. A missing value in any element or param will be stored as the empty
String
; if the "=" is also missing null will be stored instead.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getName()
Returns header element name.NameValuePair
getParameter(int index)
Returns parameter with the given index.NameValuePair
getParameterByName(java.lang.String name)
Returns the first parameter with the given name.int
getParameterCount()
Returns the total count of parameters.NameValuePair[]
getParameters()
Returns an array of name / value pairs.java.lang.String
getValue()
Returns header element value.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns header element name.- Returns:
- header element name
-
getValue
java.lang.String getValue()
Returns header element value.- Returns:
- header element value
-
getParameters
NameValuePair[] getParameters()
Returns an array of name / value pairs.- Returns:
- array of name / value pairs
-
getParameterByName
NameValuePair getParameterByName(java.lang.String name)
Returns the first parameter with the given name.- Parameters:
name
- parameter name- Returns:
- name / value pair
-
getParameterCount
int getParameterCount()
Returns the total count of parameters.- Returns:
- parameter count
-
getParameter
NameValuePair getParameter(int index)
Returns parameter with the given index.- Parameters:
index
- index- Returns:
- name / value pair
-
-