Class HttpClient


  • public class HttpClient
    extends java.lang.Object
    Http Service using the build in Java HttpURLConnection library.
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpClient()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static HttpResponse get​(java.lang.String url)
      Send 'Get' request.
      static HttpResponse post​(java.lang.String url, java.lang.String body)
      Send Http POST.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpClient

        public HttpClient()
    • Method Detail

      • get

        public static HttpResponse get​(java.lang.String url)
                                throws java.io.IOException
        Send 'Get' request.
        Parameters:
        url - String
        Returns:
        HttpResponse
        Throws:
        java.io.IOException - IOException
      • post

        public static HttpResponse post​(java.lang.String url,
                                        java.lang.String body)
                                 throws java.io.IOException
        Send Http POST.
        Parameters:
        url - String
        body - String
        Returns:
        HttpResponse
        Throws:
        java.io.IOException - IOException