Package io.micronaut.http
Interface HttpRequestFactory
-
- All Known Implementing Classes:
SimpleHttpRequestFactory
public interface HttpRequestFactoryA factory interface forMutableHttpRequestobjects.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static HttpRequestFactoryINSTANCEThe defaultCookieFactoryinstance.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> MutableHttpRequest<T>create(HttpMethod httpMethod, java.lang.String uri)Create a newMutableHttpRequestfor the given method and URI.default <T> MutableHttpRequest<T>create(HttpMethod httpMethod, java.lang.String uri, java.lang.String httpMethodName)Allows to create request including non-standard http methods.<T> MutableHttpRequest<T>delete(java.lang.String uri, T body)Return aMutableHttpRequestthat executes anHttpMethod.DELETErequest for the given URI.<T> MutableHttpRequest<T>get(java.lang.String uri)Return aMutableHttpRequestthat executes anHttpMethod.GETrequest for the given URI.<T> MutableHttpRequest<T>head(java.lang.String uri)Return aMutableHttpRequestthat executes anHttpMethod.HEADrequest for the given URI.<T> MutableHttpRequest<T>options(java.lang.String uri)Return aMutableHttpRequestthat executes anHttpMethod.OPTIONSrequest for the given URI.<T> MutableHttpRequest<T>patch(java.lang.String uri, T body)Return aMutableHttpRequestthat executes anHttpMethod.PATCHrequest for the given URI.<T> MutableHttpRequest<T>post(java.lang.String uri, T body)Return aMutableHttpRequestthat executes anHttpMethod.POSTrequest for the given URI.<T> MutableHttpRequest<T>put(java.lang.String uri, T body)Return aMutableHttpRequestthat executes anHttpMethod.PUTrequest for the given URI.
-
-
-
Field Detail
-
INSTANCE
static final HttpRequestFactory INSTANCE
The defaultCookieFactoryinstance.
-
-
Method Detail
-
get
<T> MutableHttpRequest<T> get(java.lang.String uri)
Return aMutableHttpRequestthat executes anHttpMethod.GETrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
post
<T> MutableHttpRequest<T> post(java.lang.String uri, T body)
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
<T> MutableHttpRequest<T> put(java.lang.String uri, T body)
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
<T> MutableHttpRequest<T> patch(java.lang.String uri, T body)
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
<T> MutableHttpRequest<T> head(java.lang.String uri)
Return aMutableHttpRequestthat executes anHttpMethod.HEADrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
options
<T> MutableHttpRequest<T> options(java.lang.String uri)
Return aMutableHttpRequestthat executes anHttpMethod.OPTIONSrequest for the given URI.- Type Parameters:
T- The Http request type- Parameters:
uri- The URI- Returns:
- The
MutableHttpRequestinstance
-
delete
<T> MutableHttpRequest<T> delete(java.lang.String uri, T body)
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
<T> MutableHttpRequest<T> create(HttpMethod httpMethod, java.lang.String uri)
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
default <T> MutableHttpRequest<T> create(HttpMethod httpMethod, java.lang.String uri, java.lang.String httpMethodName)
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
-
-