Class HttpProtocol


  • public class HttpProtocol
    extends Object
    Helper methods that need to be used when dealing with the HTTP protocol.
    Since:
    2.0.0
    • Constructor Detail

      • HttpProtocol

        public HttpProtocol()
    • Method Detail

      • addHttpBasicAuth

        public static void addHttpBasicAuth​(com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpRequest request,
                                            String user,
                                            String password)
        Adds http basic auth to a given request.
        Parameters:
        request - the request where it should be added.
        user - the username.
        password - the password.
      • remoteHttpHost

        public static String remoteHttpHost​(SocketAddress remoteAddress)
        Calculates the remote host for caching so that it is set on each query request.
        Parameters:
        remoteAddress - the remote address.
        Returns:
        the converted remote http host.