Class HttpClient

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public final class HttpClient
     implements Closeable
                        

    Client to use other REST services.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final List<Cookie> getCookies()
      final Unit setCookies(List<Cookie> cookies)
      final HttpClientSettings getSettings()
      final HttpHandler getHandler()
      Unit close()
      final Map<String, Cookie> cookiesMap()
      final Unit start()
      final Unit stop()
      final Boolean started()
      final HttpResponsePort send(HttpRequest request, Map<String, Object> attributes) Synchronous execution.
      final Flow.Publisher<ServerEvent> sse(HttpRequest request)
      final Flow.Publisher<ServerEvent> sse(String path)
      final WsSession ws(String path, Function1<WsSession, Unit> onConnect, Function2<WsSession, ByteArray, Unit> onBinary, Function2<WsSession, String, Unit> onText, Function2<WsSession, ByteArray, Unit> onPing, Function2<WsSession, ByteArray, Unit> onPong, Function3<WsSession, Integer, String, Unit> onClose)
      final Unit request(Function1<HttpClient, Unit> block)
      final HttpResponsePort get(String path, Headers headers, Object body, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort head(String path, Headers headers)
      final HttpResponsePort post(String path, Object body, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort put(String path, Object body, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort delete(String path, Object body, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort trace(String path, Object body, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort options(String path, Object body, Headers headers, ContentType contentType, List<ContentType> accept)
      final HttpResponsePort patch(String path, Object body, ContentType contentType, List<ContentType> accept)
      • Methods inherited from class java.lang.Object

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

      • setCookies

         final Unit setCookies(List<Cookie> cookies)
      • cookiesMap

         final Map<String, Cookie> cookiesMap()
      • start

         final Unit start()
      • stop

         final Unit stop()
      • send

         final HttpResponsePort send(HttpRequest request, Map<String, Object> attributes)

        Synchronous execution.

      • sse

         final Flow.Publisher<ServerEvent> sse(HttpRequest request)
      • sse

         final Flow.Publisher<ServerEvent> sse(String path)
      • ws

         final WsSession ws(String path, Function1<WsSession, Unit> onConnect, Function2<WsSession, ByteArray, Unit> onBinary, Function2<WsSession, String, Unit> onText, Function2<WsSession, ByteArray, Unit> onPing, Function2<WsSession, ByteArray, Unit> onPong, Function3<WsSession, Integer, String, Unit> onClose)
      • get

         final HttpResponsePort get(String path, Headers headers, Object body, ContentType contentType, List<ContentType> accept)
      • head

         final HttpResponsePort head(String path, Headers headers)
      • post

         final HttpResponsePort post(String path, Object body, ContentType contentType, List<ContentType> accept)
      • put

         final HttpResponsePort put(String path, Object body, ContentType contentType, List<ContentType> accept)
      • delete

         final HttpResponsePort delete(String path, Object body, ContentType contentType, List<ContentType> accept)
      • trace

         final HttpResponsePort trace(String path, Object body, ContentType contentType, List<ContentType> accept)
      • options

         final HttpResponsePort options(String path, Object body, Headers headers, ContentType contentType, List<ContentType> accept)
      • patch

         final HttpResponsePort patch(String path, Object body, ContentType contentType, List<ContentType> accept)