Package io.micronaut.http.simple
Class SimpleHttpRequestFactory
- java.lang.Object
-
- io.micronaut.http.simple.SimpleHttpRequestFactory
-
- All Implemented Interfaces:
HttpRequestFactory
public class SimpleHttpRequestFactory extends java.lang.Object implements HttpRequestFactory
SimpleHttpRequestFactory
implementation. This is the default fallback factory.- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.http.HttpRequestFactory
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpRequestFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> MutableHttpRequest<T>
create(HttpMethod httpMethod, java.lang.String uri)
Create a newMutableHttpRequest
for the given method and URI.<T> MutableHttpRequest<T>
delete(java.lang.String uri, T body)
Return aMutableHttpRequest
that executes anHttpMethod.DELETE
request for the given URI.<T> MutableHttpRequest<T>
get(java.lang.String uri)
Return aMutableHttpRequest
that executes anHttpMethod.GET
request for the given URI.<T> MutableHttpRequest<T>
head(java.lang.String uri)
Return aMutableHttpRequest
that executes anHttpMethod.HEAD
request for the given URI.<T> MutableHttpRequest<T>
options(java.lang.String uri)
Return aMutableHttpRequest
that executes anHttpMethod.OPTIONS
request for the given URI.<T> MutableHttpRequest<T>
patch(java.lang.String uri, T body)
Return aMutableHttpRequest
that executes anHttpMethod.PATCH
request for the given URI.<T> MutableHttpRequest<T>
post(java.lang.String uri, T body)
Return aMutableHttpRequest
that executes anHttpMethod.POST
request for the given URI.<T> MutableHttpRequest<T>
put(java.lang.String uri, T body)
Return aMutableHttpRequest
that executes anHttpMethod.PUT
request for the given URI.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.http.HttpRequestFactory
create
-
-
-
-
Method Detail
-
get
public <T> MutableHttpRequest<T> get(java.lang.String uri)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.GET
request for the given URI.- Specified by:
get
in interfaceHttpRequestFactory
- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
post
public <T> MutableHttpRequest<T> post(java.lang.String uri, T body)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.POST
request for the given URI.- Specified by:
post
in interfaceHttpRequestFactory
- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
put
public <T> MutableHttpRequest<T> put(java.lang.String uri, T body)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.PUT
request for the given URI.- Specified by:
put
in interfaceHttpRequestFactory
- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
patch
public <T> MutableHttpRequest<T> patch(java.lang.String uri, T body)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.PATCH
request for the given URI.- Specified by:
patch
in interfaceHttpRequestFactory
- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- The body- Returns:
- The
MutableHttpRequest
instance
-
head
public <T> MutableHttpRequest<T> head(java.lang.String uri)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.HEAD
request for the given URI.- Specified by:
head
in interfaceHttpRequestFactory
- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
options
public <T> MutableHttpRequest<T> options(java.lang.String uri)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.OPTIONS
request for the given URI.- Specified by:
options
in interfaceHttpRequestFactory
- Type Parameters:
T
- The Http request type- Parameters:
uri
- The URI- Returns:
- The
MutableHttpRequest
instance
-
delete
public <T> MutableHttpRequest<T> delete(java.lang.String uri, T body)
Description copied from interface:HttpRequestFactory
Return aMutableHttpRequest
that executes anHttpMethod.DELETE
request for the given URI.- Specified by:
delete
in interfaceHttpRequestFactory
- Type Parameters:
T
- The body type- Parameters:
uri
- The URIbody
- an optional body- Returns:
- The
MutableHttpRequest
instance
-
create
public <T> MutableHttpRequest<T> create(HttpMethod httpMethod, java.lang.String uri)
Description copied from interface:HttpRequestFactory
Create a newMutableHttpRequest
for the given method and URI.- Specified by:
create
in interfaceHttpRequestFactory
- Type Parameters:
T
- The Http request type- Parameters:
httpMethod
- The methoduri
- The URI- Returns:
- The request
-
-