Class HttpClient

  • All Implemented Interfaces:

    
    public final class HttpClient
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static HttpResponse execute(HttpRequest $self, Long timeoutMillis) Synchronously executes request on the current thread and blocks while waiting for at most the given time for the response.
      final static HttpResponse execute(HttpRequest $self) Synchronously executes request on the current thread and blocks while waiting for at most the given time for the response.
      final static Unit enqueue(HttpRequest $self, HttpCallback callback) Asynchronously send the request.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • execute

         final static HttpResponse execute(HttpRequest $self, Long timeoutMillis)

        Synchronously executes request on the current thread and blocks while waiting for at most the given time for the response.

        Parameters:
        timeoutMillis - time to wait before cancelling the operation.
        Returns:

        the computed response

      • execute

         final static HttpResponse execute(HttpRequest $self)

        Synchronously executes request on the current thread and blocks while waiting for at most the given time for the response.

        Returns:

        the computed response

      • enqueue

         final static Unit enqueue(HttpRequest $self, HttpCallback callback)

        Asynchronously send the request.

        Parameters:
        callback - the HTTP callback that notify of its successful response or error