Package org.simpleframework.http
Interface RequestLine
- All Known Subinterfaces:
Request
,RequestHeader
- All Known Implementing Classes:
RequestWrapper
public interface RequestLine
The
RequestLine
is used to represent a HTTP request
line. The methods provided for this can be used to provide easy
access to the components of a HTTP request line. For the syntax
of a HTTP request line see RFC 2616.- Author:
- Niall Gallagher
-
Method Summary
Modifier and TypeMethodDescriptionThis is used to acquire the address from the request line.int
getMajor()
This can be used to get the major number from a HTTP version.This can be used to get the HTTP method for this request.int
getMinor()
This can be used to get the major number from a HTTP version.getPath()
This is used to acquire the path as extracted from the HTTP request URI.getQuery()
This method is used to acquire the query part from the HTTP request URI target.This can be used to get the URI specified for this HTTP request.
-
Method Details
-
getMethod
String getMethod()This can be used to get the HTTP method for this request. The HTTP specification RFC 2616 specifies the HTTP request methods in section 9, Method Definitions. Typically this will be a GET, POST or a HEAD method, although any string is possible.- Returns:
- the request method for this request message
-
getTarget
String getTarget()This can be used to get the URI specified for this HTTP request. This corresponds to the /index part of a http://www.domain.com/index URL but may contain the full URL. This is a read only value for the request.- Returns:
- the URI that this HTTP request is targeting
-
getAddress
Address getAddress()This is used to acquire the address from the request line. An address is the full URI including the scheme, domain, port and the query parts. This allows various parameters to be acquired without having to parse the raw request target URI.- Returns:
- this returns the address of the request line
-
getPath
Path getPath()This is used to acquire the path as extracted from the HTTP request URI. ThePath
object that is provided by this method is immutable, it represents the normalized path only part from the request uniform resource identifier.- Returns:
- this returns the normalized path for the request
-
getQuery
Query getQuery()This method is used to acquire the query part from the HTTP request URI target. This will return only the values that have been extracted from the request URI target.- Returns:
- the query associated with the HTTP target URI
-
getMajor
int getMajor()This can be used to get the major number from a HTTP version. The major version corresponds to the major type that is the 1 of a HTTP/1.0 version string.- Returns:
- the major version number for the request message
-
getMinor
int getMinor()This can be used to get the major number from a HTTP version. The major version corresponds to the major type that is the 0 of a HTTP/1.0 version string. This is used to determine if the request message has keep alive semantics.- Returns:
- the major version number for the request message
-