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
FieldsModifier and TypeFieldDescriptionstatic final HttpRequestFactoryThe defaultCookieFactoryinstance. -
Method Summary
Modifier and TypeMethodDescription<T> MutableHttpRequest<T>create(HttpMethod httpMethod, String uri) Create a newMutableHttpRequestfor 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 aMutableHttpRequestthat executes anHttpMethod.DELETErequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.GETrequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.HEADrequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.OPTIONSrequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.PATCHrequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.POSTrequest for the given URI.<T> MutableHttpRequest<T>Return aMutableHttpRequestthat executes anHttpMethod.PUTrequest for the given URI.
-
Field Details
-
INSTANCE
The defaultCookieFactoryinstance.
-
-
Method Details
-
get
Return aMutableHttpRequestthat executes anHttpMethod.GETrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
post
Return aMutableHttpRequestthat executes anHttpMethod.POSTrequest for the given URI.- Type Parameters:
T- The body type- Parameters:
uri- The URIbody- The body- Returns:
- The
MutableHttpRequestinstance
-
put
Return aMutableHttpRequestthat executes anHttpMethod.PUTrequest for the given URI.- Type Parameters:
T- The body type- Parameters:
uri- The URIbody- The body- Returns:
- The
MutableHttpRequestinstance
-
patch
Return aMutableHttpRequestthat executes anHttpMethod.PATCHrequest for the given URI.- Type Parameters:
T- The body type- Parameters:
uri- The URIbody- The body- Returns:
- The
MutableHttpRequestinstance
-
head
Return aMutableHttpRequestthat executes anHttpMethod.HEADrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
options
Return aMutableHttpRequestthat executes anHttpMethod.OPTIONSrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
delete
Return aMutableHttpRequestthat executes anHttpMethod.DELETErequest for the given URI.- Type Parameters:
T- The body type- Parameters:
uri- The URIbody- an optional body- Returns:
- The
MutableHttpRequestinstance
-
create
Create a newMutableHttpRequestfor 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
-