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 Details

  • Method Details

    • get

      public static final String get​(String url, String options) throws IOException
      Performs a GET request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - In case an I/O exception occurs
    • post

      public static final String post​(String url, String options) throws IOException
      Performs a POST request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - In case an I/O exception occurs
    • put

      public static final String put​(String url, String options) throws IOException
      Performs a PUT request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • patch

      public static final String patch​(String url, String options) throws IOException
      Performs a PATCH request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • delete

      public static final String delete​(String url, String options) throws IOException
      Performs a DELETE request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - In case an I/O exception occurs
    • head

      public static final String head​(String url, String options) throws IOException
      Performs a HEAD request for the specified URL and options
      Parameters:
      url - the URL
      options - the options
      Returns:
      the response as JSON
      Throws:
      IOException - In case an I/O exception occurs
    • trace

      public static final String trace​(String url, String options) throws IOException
      Performs a TRACE request for the specified URL and options
      Parameters:
      url - the URL
      options - 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

      public static HttpClientRequestOptions parseOptions​(String options)
      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 IOException
      Build 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 IOException
      Build 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 IOException
      Build 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: