java.lang.Object
org.gcube.social_networking.social_networking_client_library.utils.HttpClient

public class HttpClient extends Object
Jersey client with post and get methods
Author:
Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <R> R
    get(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl)
    Executes a get request
    static <R> R
    post(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl, Object obj)
    Executes a post request
    static <R> R
    postFormData(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl, jakarta.ws.rs.core.Form form)
    Executes a post request

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpClient

      public HttpClient()
  • Method Details

    • get

      public static <R> R get(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl)
      Executes a get request
      Type Parameters:
      R - the generic type
      Parameters:
      returnType - the return type
      requestUrl - the request url
      Returns:
      the result
    • post

      public static <R> R post(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl, Object obj)
      Executes a post request
      Type Parameters:
      R - the generic type
      Parameters:
      returnType - the return type
      requestUrl - the request url
      obj - the object to post
      Returns:
      the result
    • postFormData

      public static <R> R postFormData(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl, jakarta.ws.rs.core.Form form)
      Executes a post request
      Type Parameters:
      R - the generic type
      Parameters:
      returnType - the return type
      requestUrl - the request url
      form - the form to post
      Returns:
      the result