public class HttpHeaderFields extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SHF_Accept |
static String |
SHF_Accept_Charset |
static String |
SHF_Accept_Encoding |
static String |
SHF_Accept_Language |
static String |
SHF_Authorization |
static String |
SHF_Connection |
static String |
SHF_Content_Length |
static String |
SHF_Content_Type |
static String |
SHF_Expect |
static String |
SHF_From |
static String |
SHF_Host |
static String |
SHF_If_Match |
static String |
SHF_If_Modified_Since |
static String |
SHF_If_None_Match |
static String |
SHF_If_Range |
static String |
SHF_If_Unmodified_Since |
static String |
SHF_Location |
static String |
SHF_Max_Forwards |
static String |
SHF_Proxy_Authorization |
static String |
SHF_Range |
static String |
SHF_Referer |
static String |
SHF_TE |
static String |
SHF_User_Agent |
static String |
SHF_WWW_Authorization |
Constructor and Description |
---|
HttpHeaderFields(String[] headerLines)
Creates the header fields from a string array of the HTTP header.
|
Modifier and Type | Method and Description |
---|---|
LinkedHashMap<String,String[]> |
getAllHeaderFields()
Gets all the first header fields of each type into a new LinkedHashMap.
|
int |
getContentLength()
Gets the contents length.
|
Vector<HttpCookie> |
getCookies()
Gets the cookies associated with the request.
|
String |
getHeader(String name)
Get the header first of a certain index in the SHF_* strings or another user defined string.
|
Set<Map.Entry<String,String>> |
getHeaderEntrySet()
Deprecated.
"for-removal"
|
LinkedHashMap<String,String> |
getHeaderFields()
Deprecated.
"for-removal"
|
Enumeration<String> |
getHeaders()
Deprecated.
"for-removal"
|
String[] |
getHeaders(String name)
Get all header fields of a certain index in the SHF_* strings or another user defined string.
|
Iterator<String> |
getHeadersIterator()
Gets the Iterator of header field keys.
|
Set<String> |
getHeadersSet()
Get enumeration of header field keys.
|
String |
getHostAddress()
Gets the host address of a GET request.
|
String |
getMultipartBoundary()
Get the multipart Content-type boundary.
|
String[] |
getRawHeaderLines()
Gets the raw header lines strings array.
|
boolean |
hasHostAddress()
Checks if the header fields contains the "Host: address" header field
that makes it value for a GET.
|
boolean |
isFormData()
Checks if the data is used in conjuction with HTML forms,
i.e.
|
boolean |
isKeepAlive()
Checks if the request is of "Keep-Alive" type.
|
boolean |
isMultipartFormData()
Checks if the data is used in conjuction with HTML forms,
i.e.
|
public static final String SHF_Accept
public static final String SHF_Accept_Charset
public static final String SHF_Accept_Encoding
public static final String SHF_Accept_Language
public static final String SHF_Authorization
public static final String SHF_Connection
public static final String SHF_Content_Length
public static final String SHF_Content_Type
public static final String SHF_Expect
public static final String SHF_From
public static final String SHF_Host
public static final String SHF_Location
public static final String SHF_If_Match
public static final String SHF_If_Modified_Since
public static final String SHF_If_None_Match
public static final String SHF_If_Range
public static final String SHF_If_Unmodified_Since
public static final String SHF_Max_Forwards
public static final String SHF_Proxy_Authorization
public static final String SHF_Range
public static final String SHF_Referer
public static final String SHF_TE
public static final String SHF_User_Agent
public static final String SHF_WWW_Authorization
public HttpHeaderFields(String[] headerLines)
Each field start at the beginning of the line and is directly followed by a colon, optional white space (in our case always a space, because Tab has already been converted) and then an optional value.
The first header string is skipped because it contains the request line.
public String[] getRawHeaderLines()
public Vector<HttpCookie> getCookies()
The HttpCookie object only has the NAME and VALUE members set. Optionally the PATH and DOMAIN members are set for Version 1 cookies. All other members are null. Note: duplicate names may exist, typically with different paths or domains.
HttpCookie
public String getHeader(String name)
name
- The name of the header.public String[] getHeaders(String name)
name
- The name of the header.@Deprecated public LinkedHashMap<String,String> getHeaderFields()
#getAllHeaderFields()}
public LinkedHashMap<String,String[]> getAllHeaderFields()
public boolean hasHostAddress()
public String getHostAddress()
public boolean isFormData()
public boolean isMultipartFormData()
public String getMultipartBoundary()
public boolean isKeepAlive()
public int getContentLength()
public Iterator<String> getHeadersIterator()
@Deprecated public Set<Map.Entry<String,String>> getHeaderEntrySet()
#getAllHeaderFields()}
@Deprecated public Enumeration<String> getHeaders()
#getHeadersIterator()}
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.