Class HttpService


  • public class HttpService
    extends Object
    • Method Detail

      • get

        public String get​(String url,
                          Credential credential)
                   throws IOException
        Call GET request with credential
        Parameters:
        url - API url
        credential - credential
        Returns:
        response body
        Throws:
        IOException - if API call fail
      • post

        public String post​(String url,
                           Credential credential,
                           String body)
                    throws IOException
        Call POST request with credential and body
        Parameters:
        url - API url
        credential - credential
        body - request body
        Returns:
        response body
        Throws:
        IOException - if API call fail
      • put

        public String put​(String url,
                          String filePath)
                   throws IOException
        Call PUT request with file content
        Parameters:
        url - API url
        filePath - path to upload file
        Returns:
        response body
        Throws:
        IOException - if API call fail