Class HttpClient
java.lang.Object
org.gcube.social_networking.social_networking_client_library.utils.HttpClient
Jersey client with post and get methods
- Author:
- Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <R> Rget(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl) Executes a get requeststatic <R> Rpost(jakarta.ws.rs.core.GenericType<org.gcube.social_networking.socialnetworking.model.output.ResponseBean<R>> returnType, String requestUrl, Object obj) Executes a post requeststatic <R> RpostFormData(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
-
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 typerequestUrl- 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 typerequestUrl- the request urlobj- 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 typerequestUrl- the request urlform- the form to post- Returns:
- the result
-