java.lang.Object
com.renomad.minum.web.RequestLine
This class holds data and methods for dealing with the
"start line" in an HTTP request. For example,
GET /foo HTTP/1.1
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
These are the HTTP methods we handle. -
Field Summary
-
Constructor Summary
ConstructorDescriptionRequestLine
(RequestLine.Method method, PathDetails pathDetails, HttpVersion version, String rawValue, ILogger logger) -
Method Summary
Modifier and TypeMethodDescriptionboolean
extractRequestLine
(String value) Given the string value of a Request Line (like GET /hello HTTP/1.1) validate and extract the values for our use.Return the method of this request-line.This returns an object which contains essential information about the path in the request line.Get the string value of this request line, such as "GET /sample.html HTTP/1.1"Gets the HTTP version, either 1.0 or 1.1int
hashCode()
Returns a map of the key-value pairs in the URL, for example inhttp://foo.com?name=alice
you have a key of name and a value of alice.toString()
-
Field Details
-
EMPTY
-
-
Constructor Details
-
RequestLine
public RequestLine(RequestLine.Method method, PathDetails pathDetails, HttpVersion version, String rawValue, ILogger logger) - Parameters:
method
- GET, POST, etc.pathDetails
- SeePathDetails
version
- the version of HTTP (1.0 or 1.1) we're receivingrawValue
- the entire raw string of the start line
-
-
Method Details
-
queryString
Returns a map of the key-value pairs in the URL, for example inhttp://foo.com?name=alice
you have a key of name and a value of alice. -
extractRequestLine
Given the string value of a Request Line (like GET /hello HTTP/1.1) validate and extract the values for our use. -
getMethod
Return the method of this request-line. For example, GET, PUT, POST... -
getPathDetails
This returns an object which contains essential information about the path in the request line. For example, if the request line is "GET /sample?foo=bar HTTP/1.1", this would hold data for the path ("sample") and the query string ("foo=bar") -
getVersion
Gets the HTTP version, either 1.0 or 1.1 -
getRawValue
Get the string value of this request line, such as "GET /sample.html HTTP/1.1" -
equals
-
hashCode
public int hashCode() -
toString
-