Package org.imixs.workflow.services.rest
Klasse RestClient
java.lang.Object
org.imixs.workflow.services.rest.RestClient
The Imixs RestClient is a helper class for a Rest based communication without
the use of Jax-rs.
The Imixs RestClient provides methods to GET and POST data objects.
The client throws a RestAPIException in case of an communication error.
For a convinient way to access the Imixs-Rest API use the Imixs-Melman project on Github.
- Autor:
- Ralph Soika
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungGets the content of a GET request from a Rest Service URI Endpoint.intThis method returns the last HTTP ResultPosts a byte array to a Rest Service URI Endpoint.Posts a byte array to a Rest Service URI Endpoint.Posts a String data object with a specific Content-Type to a Rest Service URI Endpoint.Posts a String data object with a specific Content-Type to a Rest Service URI Endpoint.voidregisterRequestFilter(RequestFilter filter) Register a ClientRequestFilter instance.voidsetEncoding(String aEncoding) voidsetRequestProperty(String key, String value) Set a single header request property
-
Felddetails
-
requestFilterList
-
-
Konstruktordetails
-
RestClient
public RestClient() -
RestClient
-
-
Methodendetails
-
registerRequestFilter
Register a ClientRequestFilter instance.- Parameter:
filter- - request filter instance.
-
getEncoding
-
setEncoding
-
getServiceEndpoint
-
setRequestProperty
Set a single header request property -
post
Posts a String data object with a specific Content-Type to a Rest Service URI Endpoint. This method can be used to simulate different post scenarios.The parameter 'contnetType' can be used to request a specific media type.
- Parameter:
uri- - Rest Endpoint URIdataString- - contentcontentType- - request MediaType- Gibt zurück:
- content
- Löst aus:
RestAPIExceptionException
-
post
public String post(String uri, String dataString, String _contentType, String acceptType) throws RestAPIException Posts a String data object with a specific Content-Type to a Rest Service URI Endpoint. This method can be used to simulate different post scenarios.The parameter 'contnetType' and 'acceptType' can be used to request and accept specific media types.
- Parameter:
uri- - Rest Endpoint URIdataString- - contentacceptType- - accept MediaTypecontentType- - request MediaType- Gibt zurück:
- content
- Löst aus:
RestAPIException
-
post
Posts a byte array to a Rest Service URI Endpoint. This method can be used to simulate different post scenarios.The parameter 'contnetType' and 'acceptType' can be used to request and accept specific media types.
- Parameter:
uri- - Rest Endpoint URIdata- - contentcontentType- - request MediaTypeacceptType- - accept MediaType- Gibt zurück:
- content
- Löst aus:
RestAPIException
-
post
public String post(String uri, byte[] data, String _contentType, String acceptType) throws RestAPIException Posts a byte array to a Rest Service URI Endpoint. This method can be used to simulate different post scenarios.The parameter 'contnetType' and 'acceptType' can be used to request and accept specific media types.
- Parameter:
uri- - Rest Endpoint URIdata- - contentacceptType- - accept MediaTypecontentType- - request MediaType- Gibt zurück:
- content
- Löst aus:
RestAPIException
-
getLastHTTPResult
public int getLastHTTPResult()This method returns the last HTTP Result- Gibt zurück:
-
get
Gets the content of a GET request from a Rest Service URI Endpoint. I case of an error the method throws a RestAPIException.- Parameter:
uri- - Rest Endpoint RUI- Gibt zurück:
- - content or null if no content is available.
- Löst aus:
RestAPIException
-