Class CurlUtil

java.lang.Object
com.targomo.client.api.util.CurlUtil

public class CurlUtil extends Object
Created by gerb on 27.02.18.
  • Constructor Details

    • CurlUtil

      public CurlUtil()
  • Method Details

    • buildCurlRequest

      public static String buildCurlRequest(String url, List<String> headers, String body)
    • buildCurlRequest

      public static String buildCurlRequest(String method, String url, String queryString, List<String> headers, String body)
      Build a curl request. Only checks for body if the method is 'POST'.
      Parameters:
      method - The method of the request
      url - The base url of both the host and endpoint
      queryString - All query parameters as a string joined using '&'
      headers - A list of strings of request headers in the format 'Key: Value'
      body - The request body. If there is no body should be an empty string
      Returns:
      A full curl request