Class GXHTTPStringRequest

java.lang.Object
org.gcube.common.gxhttp.request.GXHTTPStringRequest
All Implemented Interfaces:
GXHTTP<String,HttpURLConnection>

@Deprecated(since="1.1.0", forRemoval=true) public class GXHTTPStringRequest extends Object implements GXHTTP<String,HttpURLConnection>
Deprecated, for removal: This API element is subject to removal in a future version.
use GXRequest, which returns a GXResponse
A context-aware request to a web application. It supports sending strings through Put/Post requests.
Author:
Manuele Simi (ISTI CNR), Luca Frosini (ISTI-CNR)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final org.slf4j.Logger
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Clear up the request.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    connectTimeout(int connectTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the connect timeout of the request.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    from(String agent)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the User-Agent for the request
    get()
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    header(String name, String value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a header to the request
    newRequest(String address)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new request.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    patch(String body)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sends the PATCH request to the web application.
    path(String path)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a path to the request URL
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    post(String body)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sends the POST request to the web application.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    put()
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    put(String body)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sends the PUT request to the web application.
    queryParams(Map<String,String> queryParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds query parameters to the request
    readTimeout(int readTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the read timeout of the request.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the body of the request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gcube.common.gxhttp.reference.GXHTTP

    connect, delete, get, head, options, patch, post, purge, put, trace
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
      Deprecated, for removal: This API element is subject to removal in a future version.
    • builder

      protected GXHTTPRequestBuilder builder
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • newRequest

      public static GXHTTPStringRequest newRequest(String address)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new request.
      Parameters:
      address - the address of the web app to call
      Returns:
      the request
    • withBody

      public GXHTTPStringRequest withBody(String body)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the body of the request.
      Parameters:
      body - the body
      Returns:
      the request
    • put

      public HttpURLConnection put(String body) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: GXHTTP
      Sends the PUT request to the web application.
      Specified by:
      put in interface GXHTTP<String,HttpURLConnection>
      Parameters:
      body - the body of the request
      Returns:
      the response
      Throws:
      Exception - if an error occurs
    • post

      public HttpURLConnection post(String body) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: GXHTTP
      Sends the POST request to the web application.
      Specified by:
      post in interface GXHTTP<String,HttpURLConnection>
      Parameters:
      body - the body of the request
      Returns:
      the response
      Throws:
      Exception - if an error occurs
    • patch

      public HttpURLConnection patch(String body) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: GXHTTP
      Sends the PATCH request to the web application.
      Specified by:
      patch in interface GXHTTP<String,HttpURLConnection>
      Parameters:
      body - the body of the request
      Returns:
      the response
      Throws:
      Exception - if an error occurs
    • from

      public GXHTTPStringRequest from(String agent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the User-Agent for the request
      Parameters:
      agent - the agent
      Returns:
      the request
    • path

      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a path to the request URL
      Parameters:
      path - the path to add
      Returns:
      the request
      Throws:
      UnsupportedEncodingException - if the encoding is not supported
    • header

      public GXHTTPStringRequest header(String name, String value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a header to the request
      Parameters:
      name - the name of the header
      value - the value of the header
      Returns:
      the request
    • connectTimeout

      public GXHTTPStringRequest connectTimeout(int connectTimeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the connect timeout of the request.
      Parameters:
      connectTimeout - the timeout in milliseconds; 0 means infinite
      Returns:
      the request
    • readTimeout

      public GXHTTPStringRequest readTimeout(int readTimeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the read timeout of the request.
      Parameters:
      readTimeout - the timeout in milliseconds; 0 means infinite
      Returns:
      the request
    • queryParams

      public GXHTTPStringRequest queryParams(Map<String,String> queryParams) throws UnsupportedEncodingException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds query parameters to the request
      Parameters:
      queryParams - the query parameters
      Returns:
      the request
      Throws:
      UnsupportedEncodingException - if the encoding is not supported
    • put

      public HttpURLConnection put() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • delete

      public HttpURLConnection delete() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • purge

      public HttpURLConnection purge() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • head

      public HttpURLConnection head() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • get

      public HttpURLConnection get() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • post

      public HttpURLConnection post() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • trace

      public HttpURLConnection trace() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • patch

      public HttpURLConnection patch() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • options

      public HttpURLConnection options() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • connect

      public HttpURLConnection connect() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      Exception
    • clear

      public void clear()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Clear up the request.