Class Request
- java.lang.Object
-
- com.yahoo.application.container.handler.Request
-
@Immutable @Beta public class Request extends java.lang.Object
A request for use withJDisc.handleRequest(Request)
.- Author:
- Einar M R Rosenvinge
- See Also:
Response
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Request.Method
-
Constructor Summary
Constructors Constructor Description Request(java.lang.String uri)
Creates a Request with an empty body.Request(java.lang.String uri, byte[] body)
Creates a GET Request with a message body.Request(java.lang.String uri, byte[] body, Request.Method method)
Creates a Request with a message body.Request(java.lang.String uri, byte[] body, Request.Method method, java.security.Principal principal)
Creates a Request with a message body, method and user principal.Request(java.lang.String uri, java.lang.String body)
Creates a GET Request with a message body.Request(java.lang.String uri, java.lang.String body, Request.Method method)
Creates a Request with a message body.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getAttributes()
byte[]
getBody()
Returns the body of this Request.Headers
getHeaders()
Returns a mutable multi-map of headers for this Request.Request.Method
getMethod()
java.lang.String
getUri()
Returns the URI of this Request.java.util.Optional<java.security.Principal>
getUserPrincipal()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Request
public Request(java.lang.String uri)
Creates a Request with an empty body.- Parameters:
uri
- the URI of the request
-
Request
public Request(java.lang.String uri, byte[] body)
Creates a GET Request with a message body.- Parameters:
uri
- the URI of the requestbody
- the body of the request
-
Request
public Request(java.lang.String uri, java.lang.String body)
Creates a GET Request with a message body.- Parameters:
uri
- the URI of the requestbody
- the body of the request as a UTF-8 string
-
Request
public Request(java.lang.String uri, byte[] body, Request.Method method)
Creates a Request with a message body.- Parameters:
uri
- the URI of the requestbody
- the body of the request
-
Request
public Request(java.lang.String uri, byte[] body, Request.Method method, java.security.Principal principal)
Creates a Request with a message body, method and user principal.- Parameters:
uri
- the URI of the requestbody
- the body of the requestmethod
- the method of the requestprincipal
- the user principal of the request
-
Request
public Request(java.lang.String uri, java.lang.String body, Request.Method method)
Creates a Request with a message body.- Parameters:
uri
- the URI of the requestbody
- the body of the request as a UTF-8 string
-
-
Method Detail
-
getHeaders
public Headers getHeaders()
Returns a mutable multi-map of headers for this Request.- Returns:
- a mutable multi-map of headers for this Request
-
getBody
public byte[] getBody()
Returns the body of this Request.- Returns:
- the body of this Request
-
getUri
public java.lang.String getUri()
Returns the URI of this Request.- Returns:
- the URI of this Request
-
getAttributes
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
- Returns:
- a mutable attribute map for this request.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getMethod
public Request.Method getMethod()
-
getUserPrincipal
public java.util.Optional<java.security.Principal> getUserPrincipal()
-
-