Package io.micronaut.http
Interface HttpRequestFactory
- All Known Implementing Classes:
NettyClientHttpRequestFactory
,SimpleHttpRequestFactory
public interface HttpRequestFactory
A factory interface for
MutableHttpRequest
objects.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HttpRequestFactory
The defaultCookieFactory
instance. -
Method Summary
Modifier and TypeMethodDescription<T> MutableHttpRequest<T>
create
(HttpMethod httpMethod, String uri) Create a newMutableHttpRequest
for the given method and URI.default <T> MutableHttpRequest<T>
create
(HttpMethod httpMethod, String uri, String httpMethodName) Allows to create request including non-standard http methods.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.DELETE
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.GET
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.HEAD
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.OPTIONS
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.PATCH
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.POST
request for the given URI.<T> MutableHttpRequest<T>
Return aMutableHttpRequest
that executes anHttpMethod.PUT
request for the given URI.
-
Field Details
-
INSTANCE
The defaultCookieFactory
instance.
-
-
Method Details
-
get
Return aMutableHttpRequest
that executes anHttpMethod.GET
request for the given URI.- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
post
Return aMutableHttpRequest
that executes anHttpMethod.POST
request for the given URI.- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
put
Return aMutableHttpRequest
that executes anHttpMethod.PUT
request for the given URI.- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
patch
Return aMutableHttpRequest
that executes anHttpMethod.PATCH
request for the given URI.- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
head
Return aMutableHttpRequest
that executes anHttpMethod.HEAD
request for the given URI.- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
options
Return aMutableHttpRequest
that executes anHttpMethod.OPTIONS
request for the given URI.- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
delete
Return aMutableHttpRequest
that executes anHttpMethod.DELETE
request for the given URI.- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- an optional body- Returns:
- The
MutableHttpRequest
instance
-
create
Create a newMutableHttpRequest
for the given method and URI.- Type Parameters:
T
- The Http request type- Parameters:
httpMethod
- The methoduri
- The URI- Returns:
- The request
-
create
Allows to create request including non-standard http methods.- Type Parameters:
T
- The http request type- Parameters:
httpMethod
- The methoduri
- The URIhttpMethodName
- Method name. For standard http method equals toEnum.name()
- Returns:
- The request
-