Package com.jprofiler.api.agent
Interface HttpRequest
public interface HttpRequest
An object that contains information about the current HTTP-Request.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the specified request header as aString
.Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.Returns the query string that is contained in the request URL after the path.Returns the technology-specific request object.Returns the request URI including the optional query string.Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
-
Method Details
-
getRequestURI
String getRequestURI()Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.This is equivalent to
javax.servlet.http.HttpServletRequest.getRequestURI()
.- Returns:
- a
String
containing the part of the URL from the protocol name up to the query string
-
getQueryString
String getQueryString()Returns the query string that is contained in the request URL after the path. This method returnsnull
if the URL does not have a query string.This is equivalent to
javax.servlet.http.HttpServletRequest.getQueryString()
.- Returns:
- a
String
containing the query string ornull
if the URL contains no query string.
-
getRequestString
String getRequestString()Returns the request URI including the optional query string.- Returns:
- a
String
containing the content ofgetRequestURI()
optionally followed by the query string.
-
getMethod
String getMethod()Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.- Returns:
- a
String
with the method name
-
getHeader
Returns the value of the specified request header as aString
. If the request did not include a header of the specified name, this method returnsnull
. If there are multiple headers with the same name, this method returns the first header in the request.Case sensitivity is handled by the technology-specific request object.
This is equivalent to
javax.servlet.http.HttpServletRequest.getHeader()
.- Parameters:
name
- aString
specifying the header name- Returns:
- a
String
containing the value of the requested header, ornull
if the request does not have a header of that name
-
getRequestObject
Object getRequestObject()Returns the technology-specific request object.- Returns:
- For servlet containers, a
javax.servlet.http.HttpServletRequest
, for Netty-HTTP/1 aio.netty.handler.codec.http.HttpRequest
, for Netty-HTTP/2 aio.netty.handler.codec.http2.Http2Headers
object
-