Class HttpClientFacade
java.lang.Object
org.eclipse.dirigible.api.v3.http.HttpClientFacade
- All Implemented Interfaces:
IScriptingFacade
public class HttpClientFacade extends Object implements IScriptingFacade
Java face for HTTP operations
-
Constructor Summary
Constructors Constructor Description HttpClientFacade() -
Method Summary
Modifier and Type Method Description static org.apache.http.client.methods.HttpDeletecreateDeleteRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP DELETE Requeststatic org.apache.http.client.methods.HttpGetcreateGetRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP GET Requeststatic org.apache.http.client.methods.HttpHeadcreateHeadRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP HEAD Requeststatic org.apache.http.client.methods.HttpPatchcreatePatchRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP PATCH Requeststatic org.apache.http.client.methods.HttpPostcreatePostRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP POST Requeststatic org.apache.http.client.methods.HttpPutcreatePutRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP PUT Requeststatic org.apache.http.client.methods.HttpTracecreateTraceRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP TRACE Requeststatic Stringdelete(String url, String options)Performs a DELETE request for the specified URL and optionsstatic Stringget(String url, String options)Performs a GET request for the specified URL and optionsstatic Stringhead(String url, String options)Performs a HEAD request for the specified URL and optionsstatic HttpClientRequestOptionsparseOptions(String options)Parse HTTP Request Optionsstatic Stringpatch(String url, String options)Performs a PATCH request for the specified URL and optionsstatic Stringpost(String url, String options)Performs a POST request for the specified URL and optionsstatic org.apache.http.client.config.RequestConfigprepareConfig(String httpClientRequestOptions)Prepare HTTP Request Configurationsstatic org.apache.http.client.config.RequestConfigprepareConfig(HttpClientRequestOptions httpClientRequestOptions)Prepare HTTP Request Configurationsstatic HttpClientResponseprocessHttpClientResponse(org.apache.http.client.methods.CloseableHttpResponse response, boolean binary)static Stringput(String url, String options)Performs a PUT request for the specified URL and optionsstatic Stringtrace(String url, String options)Performs a TRACE request for the specified URL and options
-
Constructor Details
-
HttpClientFacade
public HttpClientFacade()
-
-
Method Details
-
get
Performs a GET request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- In case an I/O exception occurs
-
post
Performs a POST request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- In case an I/O exception occurs
-
put
Performs a PUT request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- Signals that an I/O exception has occurred.
-
patch
Performs a PATCH request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- Signals that an I/O exception has occurred.
-
delete
Performs a DELETE request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- In case an I/O exception occurs
-
head
Performs a HEAD request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- In case an I/O exception occurs
-
trace
Performs a TRACE request for the specified URL and options- Parameters:
url- the URLoptions- the options- Returns:
- the response as JSON
- Throws:
IOException- In case an I/O exception occurs
-
processHttpClientResponse
public static HttpClientResponse processHttpClientResponse(org.apache.http.client.methods.CloseableHttpResponse response, boolean binary) throws IOException- Throws:
IOException
-
parseOptions
Parse HTTP Request Options- Parameters:
options-- Returns:
-
prepareConfig
public static org.apache.http.client.config.RequestConfig prepareConfig(String httpClientRequestOptions)Prepare HTTP Request Configurations- Parameters:
httpClientRequestOptions-- Returns:
-
prepareConfig
public static org.apache.http.client.config.RequestConfig prepareConfig(HttpClientRequestOptions httpClientRequestOptions)Prepare HTTP Request Configurations- Parameters:
httpClientRequestOptions-- Returns:
-
createGetRequest
public static org.apache.http.client.methods.HttpGet createGetRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP GET Request- Parameters:
url-httpClientRequestOptions-- Returns:
-
createPostRequest
public static final org.apache.http.client.methods.HttpPost createPostRequest(String url, HttpClientRequestOptions httpClientRequestOptions) throws IOExceptionBuild HTTP POST Request- Parameters:
url-httpClientRequestOptions-- Returns:
- Throws:
IOException
-
createPutRequest
public static final org.apache.http.client.methods.HttpPut createPutRequest(String url, HttpClientRequestOptions httpClientRequestOptions) throws IOExceptionBuild HTTP PUT Request- Parameters:
url-httpClientRequestOptions-- Returns:
- Throws:
IOException
-
createPatchRequest
public static final org.apache.http.client.methods.HttpPatch createPatchRequest(String url, HttpClientRequestOptions httpClientRequestOptions) throws IOExceptionBuild HTTP PATCH Request- Parameters:
url-httpClientRequestOptions-- Returns:
- Throws:
IOException
-
createDeleteRequest
public static org.apache.http.client.methods.HttpDelete createDeleteRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP DELETE Request- Parameters:
url-httpClientRequestOptions-- Returns:
-
createHeadRequest
public static org.apache.http.client.methods.HttpHead createHeadRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP HEAD Request- Parameters:
url-httpClientRequestOptions-- Returns:
-
createTraceRequest
public static org.apache.http.client.methods.HttpTrace createTraceRequest(String url, HttpClientRequestOptions httpClientRequestOptions)Build HTTP TRACE Request- Parameters:
url-httpClientRequestOptions-- Returns:
-