Class HttpUtility


  • public final class HttpUtility
    extends Object
    Helper methods for http calls
    Author:
    ramittal
    • Method Detail

      • postData

        public static <T> ANetApiResponse postData​(Environment env,
                                                   ANetApiRequest request,
                                                   Class<T> classType)
        Posts a http request
        Parameters:
        env - Env to point to
        request - Http request to send
        classType - Expected response type if successful
        Returns:
        ANetApiResponse successful or failed response
      • convertStreamToString

        public static String convertStreamToString​(InputStream is)
        Converts a response inputstream into a string.
        Parameters:
        is - input stream
        Returns:
        String contents of the input stream, without BOM