public interface RestClient extends org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.net.UserAgentAccessor.UserAgentProperty, org.refcodes.net.UserAgentAccessor.UserAgentBuilder<RestClient>
HttpRestServer
.
For marshaling and unmarshaling HTTP bodies you have to register the
according MediaTypeFactory
instances being capable of handling the
according MediaType
definitions. Examples for ready to use
MediaTypeFactory
implementations are
ApplicationJsonFactory
,
ApplicationXmlFactory
ApplicationFormFactory
TextPlainFactory
RestClient
interface, such as the
HttpRestClientImpl
, are initialized with some common
MediaTypeFactory
instances.
You may set an individual User-Agent via UserAgentAccessor.UserAgentMutator.setUserAgent(String)
, not
setting it will result in the default User-Agent to be set as coded into the
RestClient
implementations.org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
org.refcodes.net.UserAgentAccessor.UserAgentBuilder<B extends org.refcodes.net.UserAgentAccessor.UserAgentBuilder<B>>, org.refcodes.net.UserAgentAccessor.UserAgentMutator, org.refcodes.net.UserAgentAccessor.UserAgentProperty
Modifier and Type | Method and Description |
---|---|
default RestCallerBuilder |
doDelete(String aLocator,
org.refcodes.net.FormFields aQueryFields,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a DELETE request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doDelete(String aLocator,
org.refcodes.net.FormFields aQueryFields,
RestResponseObserver aResponseObserver)
Creates a DELETE request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doDelete(String aLocator,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a DELETE request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doDelete(String aLocator,
RestResponseObserver aResponseObserver)
Creates a DELETE request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doGet(String aLocator,
org.refcodes.net.FormFields aQueryFields,
RestResponseObserver aResponseObserver)
Creates a GET request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doGet(String aLocator,
RestResponseObserver aResponseObserver)
Creates a GET request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPost(String aLocator,
org.refcodes.net.FormFields aQueryFields,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a POST request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPost(String aLocator,
org.refcodes.net.FormFields aQueryFields,
RestResponseObserver aResponseObserver)
Creates a POST request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPost(String aLocator,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a POST request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPost(String aLocator,
RestResponseObserver aResponseObserver)
Creates a POST request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPut(String aLocator,
org.refcodes.net.FormFields aQueryFields,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a PUT request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPut(String aLocator,
org.refcodes.net.FormFields aQueryFields,
RestResponseObserver aResponseObserver)
Creates a PUT request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPut(String aLocator,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a PUT request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doPut(String aLocator,
RestResponseObserver aResponseObserver)
Creates a PUT request with the common attributes and returns the
according
RestCallerBuilder instance used for the request. |
RestCallerBuilder |
doRequest(org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
org.refcodes.net.FormFields aQueryFields,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a request with the possible attributes and returns the according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doRequest(org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
org.refcodes.net.FormFields aQueryFields,
RestResponseObserver aResponseObserver)
Creates a request with the common attributes e.g. for a
HttpMethod.GET request and returns the according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doRequest(org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
Object aBody,
RestResponseObserver aResponseObserver)
Creates a request with the required attributes e.g. for a
HttpMethod.POST request and returns the according
RestCallerBuilder instance used for the request. |
default RestCallerBuilder |
doRequest(org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
RestResponseObserver aResponseObserver)
Creates a request with the minimum attributes e.g.
|
default RestClient |
withUserAgent(String aUserAgent) |
addMediaTypeFactory
default RestClient withUserAgent(String aUserAgent)
withUserAgent
in interface org.refcodes.net.UserAgentAccessor.UserAgentBuilder<RestClient>
RestCallerBuilder doRequest(org.refcodes.net.HttpMethod aHttpMethod, String aLocator, org.refcodes.net.FormFields aQueryFields, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aHttpMethod
- The HTTP method to which this RestCaller
is
bound.aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.POST
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doRequest(org.refcodes.net.HttpMethod aHttpMethod, String aLocator, Object aBody, RestResponseObserver aResponseObserver)
HttpMethod.POST
request and returns the according
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aHttpMethod
- The HTTP method to which this RestCaller
is
bound.aLocator
- The local locator to which this RestCaller
is
bound.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.POST
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doRequest(org.refcodes.net.HttpMethod aHttpMethod, String aLocator, org.refcodes.net.FormFields aQueryFields, RestResponseObserver aResponseObserver)
HttpMethod.GET
request and returns the according
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aHttpMethod
- The HTTP method to which this RestCaller
is
bound.aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doRequest(org.refcodes.net.HttpMethod aHttpMethod, String aLocator, RestResponseObserver aResponseObserver)
HttpMethod.GET
and returns the according RestCallerBuilder
instance used for the
request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aHttpMethod
- The HTTP method to which this RestCaller
is
bound.aLocator
- The local locator to which this RestCaller
is
bound.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doGet(String aLocator, org.refcodes.net.FormFields aQueryFields, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doGet(String aLocator, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPost(String aLocator, org.refcodes.net.FormFields aQueryFields, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.POST
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPost(String aLocator, org.refcodes.net.FormFields aQueryFields, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPost(String aLocator, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.POST
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPost(String aLocator, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doDelete(String aLocator, org.refcodes.net.FormFields aQueryFields, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aBody
- The body to be sent with the request (a server may ignore it
when doing a HttpMethod.DELETE
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doDelete(String aLocator, org.refcodes.net.FormFields aQueryFields, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doDelete(String aLocator, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aBody
- The body to be sent with the request (a server may ignore it
when doing a HttpMethod.DELETE
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doDelete(String aLocator, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPut(String aLocator, org.refcodes.net.FormFields aQueryFields, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.PUT
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPut(String aLocator, org.refcodes.net.FormFields aQueryFields, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aQueryFields
- The Query-Fields to be used for the HTTP
Query-String.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPut(String aLocator, Object aBody, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aBody
- The body to be sent with the request (e.g. when doing a
HttpMethod.PUT
request.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.default RestCallerBuilder doPut(String aLocator, RestResponseObserver aResponseObserver)
RestCallerBuilder
instance used for the request.
The HTTP request is actually sent not earlier than you calling
Openable.open()
on the returned
RestCallerBuilder
as the RestCallerBuilder
still may be
modified after invoking this method!aLocator
- The local locator to which this RestCaller
is
bound.aResponseObserver
- The listener processing a request targeted at
this RestCaller
.RestCaller
which is used by the request.Copyright © 2016. All rights reserved.