Class DefaultRequest

    • Field Detail

      • proxyServer

        @Nullable
        public final @Nullable ProxyServer proxyServer
    • Constructor Detail

      • DefaultRequest

        public DefaultRequest​(String method,
                              Uri uri,
                              @Nullable
                              @Nullable InetAddress address,
                              @Nullable
                              @Nullable InetAddress localAddress,
                              io.netty.handler.codec.http.HttpHeaders headers,
                              List<io.netty.handler.codec.http.cookie.Cookie> cookies,
                              byte @Nullable [] byteData,
                              @Nullable
                              @Nullable List<byte[]> compositeByteData,
                              @Nullable
                              @Nullable String stringData,
                              @Nullable
                              @Nullable ByteBuffer byteBufferData,
                              @Nullable
                              @Nullable InputStream streamData,
                              @Nullable
                              @Nullable BodyGenerator bodyGenerator,
                              List<Param> formParams,
                              List<Part> bodyParts,
                              @Nullable
                              @Nullable String virtualHost,
                              @Nullable
                              @Nullable ProxyServer proxyServer,
                              @Nullable
                              @Nullable Realm realm,
                              @Nullable
                              @Nullable File file,
                              @Nullable
                              @Nullable Boolean followRedirect,
                              @Nullable
                              @Nullable Duration requestTimeout,
                              @Nullable
                              @Nullable Duration readTimeout,
                              long rangeOffset,
                              @Nullable
                              @Nullable Charset charset,
                              ChannelPoolPartitioning channelPoolPartitioning,
                              io.netty.resolver.NameResolver<InetAddress> nameResolver)
    • Method Detail

      • getUrl

        public String getUrl()
        Specified by:
        getUrl in interface Request
        Returns:
        the url (the uri's String form)
      • getMethod

        public String getMethod()
        Specified by:
        getMethod in interface Request
        Returns:
        the request's HTTP method (GET, POST, etc.)
      • getUri

        public Uri getUri()
        Specified by:
        getUri in interface Request
        Returns:
        the uri
      • getAddress

        @Nullable
        public @Nullable InetAddress getAddress()
        Specified by:
        getAddress in interface Request
        Returns:
        the InetAddress to be used to bypass uri's hostname resolution
      • getLocalAddress

        @Nullable
        public @Nullable InetAddress getLocalAddress()
        Specified by:
        getLocalAddress in interface Request
        Returns:
        the local address to bind from
      • getHeaders

        public io.netty.handler.codec.http.HttpHeaders getHeaders()
        Specified by:
        getHeaders in interface Request
        Returns:
        the HTTP headers
      • getCookies

        public List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
        Specified by:
        getCookies in interface Request
        Returns:
        the HTTP cookies
      • getByteData

        public byte @Nullable [] getByteData()
        Specified by:
        getByteData in interface Request
        Returns:
        the request's body byte array (only non-null if it was set this way)
      • getCompositeByteData

        @Nullable
        public @Nullable List<byte[]> getCompositeByteData()
        Specified by:
        getCompositeByteData in interface Request
        Returns:
        the request's body array of byte arrays (only non-null if it was set this way)
      • getStringData

        @Nullable
        public @Nullable String getStringData()
        Specified by:
        getStringData in interface Request
        Returns:
        the request's body string (only non-null if it was set this way)
      • getByteBufferData

        @Nullable
        public @Nullable ByteBuffer getByteBufferData()
        Specified by:
        getByteBufferData in interface Request
        Returns:
        the request's body ByteBuffer (only non-null if it was set this way)
      • getStreamData

        @Nullable
        public @Nullable InputStream getStreamData()
        Specified by:
        getStreamData in interface Request
        Returns:
        the request's body InputStream (only non-null if it was set this way)
      • getBodyGenerator

        @Nullable
        public @Nullable BodyGenerator getBodyGenerator()
        Specified by:
        getBodyGenerator in interface Request
        Returns:
        the request's body BodyGenerator (only non-null if it was set this way)
      • getVirtualHost

        @Nullable
        public @Nullable String getVirtualHost()
        Specified by:
        getVirtualHost in interface Request
        Returns:
        the virtual host to connect to
      • getProxyServer

        @Nullable
        public @Nullable ProxyServer getProxyServer()
        Specified by:
        getProxyServer in interface Request
        Returns:
        the proxy server to be used to perform this request (overrides the one defined in config)
      • getRealm

        @Nullable
        public @Nullable Realm getRealm()
        Specified by:
        getRealm in interface Request
        Returns:
        the realm to be used to perform this request (overrides the one defined in config)
      • getFile

        @Nullable
        public @Nullable File getFile()
        Specified by:
        getFile in interface Request
        Returns:
        the file to be uploaded
      • getFollowRedirect

        @Nullable
        public @Nullable Boolean getFollowRedirect()
        Specified by:
        getFollowRedirect in interface Request
        Returns:
        if this request is to follow redirects. Non null values means "override config value".
      • getRequestTimeout

        public Duration getRequestTimeout()
        Specified by:
        getRequestTimeout in interface Request
        Returns:
        the request timeout. Non zero values means "override config value".
      • getReadTimeout

        public Duration getReadTimeout()
        Specified by:
        getReadTimeout in interface Request
        Returns:
        the read timeout. Non-zero values means "override config value".
      • getRangeOffset

        public long getRangeOffset()
        Specified by:
        getRangeOffset in interface Request
        Returns:
        the range header value, or 0 is not set.
      • getCharset

        @Nullable
        public @Nullable Charset getCharset()
        Specified by:
        getCharset in interface Request
        Returns:
        the charset value used when decoding the request's body.
      • getNameResolver

        public io.netty.resolver.NameResolver<InetAddress> getNameResolver()
        Specified by:
        getNameResolver in interface Request
        Returns:
        the NameResolver to be used to resolve hostnams's IP
      • getQueryParams

        public List<Param> getQueryParams()
        Specified by:
        getQueryParams in interface Request
        Returns:
        the query params resolved from the url/uri