Package de.dlr.proseo.basewrap.rest
Klasse RestOps
java.lang.Object
de.dlr.proseo.basewrap.rest.RestOps
Perform REST API calls to a provided endpoint.
- Autor:
- Hubert Asamer
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enum
A collection of HTTP Methods. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic HttpResponseInfo
restApiCall
(String user, String pw, String endPoint, String endPointPath, String payLoad, Map<String, String> queryParams, RestOps.HttpMethod method) Generic REST API client (currently only supporting GET, PUT and POST)
-
Konstruktordetails
-
RestOps
public RestOps()
-
-
Methodendetails
-
restApiCall
public static HttpResponseInfo restApiCall(String user, String pw, String endPoint, String endPointPath, String payLoad, Map<String, String> queryParams, RestOps.HttpMethod method) Generic REST API client (currently only supporting GET, PUT and POST)- Parameter:
user
- the user to authenticate withpw
- the password to authenticate withendPoint
- an URL of the REST-Endpoint (e.g. http://localhost:8080)endPointPath
- subroute of REST-URL (e.g. /ingest/param/987398724)payLoad
- the request payload as stringqueryParams
- the http query parameter (mandatory for PUT, optional for GET)method
- the HTTP method (defaults to POST)- Gibt zurück:
- response object holding HTTP return code, "Warning" header, if available, and response as String, or null, if the REST request failed with an exception
-