Klasse RestOps

java.lang.Object
de.dlr.proseo.basewrap.rest.RestOps

public class RestOps extends Object
Perform REST API calls to a provided endpoint.
Autor:
Hubert Asamer
  • 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 with
      pw - the password to authenticate with
      endPoint - 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 string
      queryParams - 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