Interface Request

  • All Known Implementing Classes:
    DefaultRequest

    public interface Request
    The Request class can be used to construct HTTP request:
       Request r = new RequestBuilder()
          .setUrl("url")
          .setRealm(
              new Realm.Builder("principal", "password")
                  .setRealmName("MyRealm")
                  .setScheme(Realm.AuthScheme.BASIC)
          ).build();
     
    • Method Detail

      • getMethod

        String getMethod()
        Returns:
        the request's HTTP method (GET, POST, etc.)
      • getUri

        Uri getUri()
        Returns:
        the uri
      • getUrl

        String getUrl()
        Returns:
        the url (the uri's String form)
      • getAddress

        InetAddress getAddress()
        Returns:
        the InetAddress to be used to bypass uri's hostname resolution
      • getLocalAddress

        InetAddress getLocalAddress()
        Returns:
        the local address to bind from
      • getHeaders

        io.netty.handler.codec.http.HttpHeaders getHeaders()
        Returns:
        the HTTP headers
      • getCookies

        List<io.netty.handler.codec.http.cookie.Cookie> getCookies()
        Returns:
        the HTTP cookies
      • getByteData

        byte[] getByteData()
        Returns:
        the request's body byte array (only non null if it was set this way)
      • getCompositeByteData

        List<byte[]> getCompositeByteData()
        Returns:
        the request's body array of byte arrays (only non null if it was set this way)
      • getStringData

        String getStringData()
        Returns:
        the request's body string (only non null if it was set this way)
      • getByteBufferData

        ByteBuffer getByteBufferData()
        Returns:
        the request's body ByteBuffer (only non null if it was set this way)
      • getStreamData

        InputStream getStreamData()
        Returns:
        the request's body InputStream (only non null if it was set this way)
      • getBodyGenerator

        BodyGenerator getBodyGenerator()
        Returns:
        the request's body BodyGenerator (only non null if it was set this way)
      • getFormParams

        List<Param> getFormParams()
        Returns:
        the request's form parameters
      • getBodyParts

        List<Part> getBodyParts()
        Returns:
        the multipart parts
      • getVirtualHost

        String getVirtualHost()
        Returns:
        the virtual host to connect to
      • getQueryParams

        List<Param> getQueryParams()
        Returns:
        the query params resolved from the url/uri
      • getProxyServer

        ProxyServer getProxyServer()
        Returns:
        the proxy server to be used to perform this request (overrides the one defined in config)
      • getRealm

        Realm getRealm()
        Returns:
        the realm to be used to perform this request (overrides the one defined in config)
      • getFile

        File getFile()
        Returns:
        the file to be uploaded
      • getFollowRedirect

        Boolean getFollowRedirect()
        Returns:
        if this request is to follow redirects. Non null values means "override config value".
      • getRequestTimeout

        int getRequestTimeout()
        Returns:
        the request timeout. Non zero values means "override config value".
      • getReadTimeout

        int getReadTimeout()
        Returns:
        the read timeout. Non zero values means "override config value".
      • getRangeOffset

        long getRangeOffset()
        Returns:
        the range header value, or 0 is not set.
      • getCharset

        Charset getCharset()
        Returns:
        the charset value used when decoding the request's body.
      • getChannelPoolPartitioning

        ChannelPoolPartitioning getChannelPoolPartitioning()
        Returns:
        the strategy to compute ChannelPool's keys
      • getNameResolver

        io.netty.resolver.NameResolver<InetAddress> getNameResolver()
        Returns:
        the NameResolver to be used to resolve hostnams's IP
      • toBuilder

        default RequestBuilder toBuilder()
        Returns:
        a new request builder using this request as a prototype