java.lang.Object
io.helidon.http.HttpPrologue
A prologue of an HTTP protocol.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpProloguecreate(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, UriPath uriPath, UriQuery uriQuery, UriFragment uriFragment) Create a new prologue with decoded values.static HttpProloguecreate(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, String unresolvedPath, boolean validatePath) Create a new prologue.booleanfragment()Fragment of the request.inthashCode()booleanhasQuery()Whether the request target contains a query delimiter.method()HTTP method of this request.protocol()Protocol name, should beHTTPin most cases.HTTP protocol version of this request.query()Query of the request.Raw protocol, should beHTTP/1.1orHTTP/2in most cases.toString()uriPath()Path or the request.withProtocol(String rawProtocol, String protocol, String protocolVersion) Create a prologue with different protocol values, preserving the path, query delimiter, method, and fragment.withUriPath(UriPath uriPath) Create a prologue with a different path, preserving the query delimiter and fragment.
-
Method Details
-
create
public static HttpPrologue create(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, String unresolvedPath, boolean validatePath) Create a new prologue.- Parameters:
rawProtocol- raw protocol string (full HTTP/1.1 or similar)protocol- protocolprotocolVersion- protocol versionhttpMethod- HTTP MethodunresolvedPath- unresolved pathvalidatePath- whether to validate path (that it contains only allowed characters)- Returns:
- a new prologue
-
create
public static HttpPrologue create(String rawProtocol, String protocol, String protocolVersion, Method httpMethod, UriPath uriPath, UriQuery uriQuery, UriFragment uriFragment) Create a new prologue with decoded values.- Parameters:
rawProtocol- raw protocol string (full HTTP/1.1 or similar)protocol- protocolprotocolVersion- protocol versionhttpMethod- HTTP MethoduriPath- resolved pathuriQuery- resolved queryuriFragment- resolved fragment- Returns:
- a new prologue
-
rawProtocol
Raw protocol, should beHTTP/1.1orHTTP/2in most cases.- Returns:
- protocol
-
protocol
Protocol name, should beHTTPin most cases.- Returns:
- protocol
-
protocolVersion
HTTP protocol version of this request.- Returns:
- protocol
-
method
HTTP method of this request.- Returns:
- method
-
uriPath
Path or the request.- Returns:
- path
-
withUriPath
Create a prologue with a different path, preserving the query delimiter and fragment.- Parameters:
uriPath- resolved path- Returns:
- prologue with the provided path
-
withProtocol
Create a prologue with different protocol values, preserving the path, query delimiter, method, and fragment.- Parameters:
rawProtocol- raw protocol stringprotocol- protocolprotocolVersion- protocol version- Returns:
- prologue with the provided protocol values
-
query
Query of the request.- Returns:
- query
-
hasQuery
public boolean hasQuery()Whether the request target contains a query delimiter.This returns
trueeven when the raw query is empty, for example for a request target ending in?.- Returns:
- whether the request target contains a query delimiter
-
fragment
Fragment of the request.- Returns:
- fragment
-
hashCode
public int hashCode() -
equals
-
toString
-