org.apache.hc.core5.http

## Interface HttpRequest

- All Superinterfaces:
    HttpMessage, MessageHeaders
  All Known Subinterfaces:
    ClassicHttpRequest
  All Known Implementing Classes:
    BasicClassicHttpRequest, BasicHttpRequest, HttpRequestWrapper

      public interface HttpRequest
      extends HttpMessage

  A request message from a client to a server includes, within the first line of that message, the method to be applied to the resource, the identifier of the resource, and the protocol version in use.
  Since:
    4.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `URIAuthority` | `getAuthority()` Returns authority of this request message.
    `String` | `getMethod()` Returns method of this request message.
    `String` | `getPath()` Returns URI path of this request message or `null` if not set.
    `String` | `getRequestUri()` Returns request URI of this request message.
    `String` | `getScheme()` Returns scheme of this request message.
    `URI` | `getUri()` Returns full request URI of this request message.
    `void` | `setAuthority(URIAuthority authority)` Sets authority of this request message.
    `void` | `setPath(String path)` Sets URI path of this request message.
    `void` | `setScheme(String scheme)` Sets scheme of this request message.
    `void` | `setUri(URI requestUri)` Sets the full request URI of this request message.

    - ### Methods inherited from interface org.apache.hc.core5.http.HttpMessage

      `addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion`

    - ### Methods inherited from interface org.apache.hc.core5.http.MessageHeaders

      `containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator`

- - ### Method Detail

    - #### getMethod

          String getMethod()

      Returns method of this request message.
      Returns:
        the request method.

    - #### getPath

          String getPath()

      Returns URI path of this request message or `null` if not set.
      Returns:
        the request URI or `null`.

    - #### setPath

          void setPath(String path)

      Sets URI path of this request message.
      Parameters:
        `path` - The URI path of this request message.
      Since:
        5.0

    - #### getScheme

          String getScheme()

      Returns scheme of this request message.
      Returns:
        the scheme or `null`.
      Since:
        5.0

    - #### setScheme

          void setScheme(String scheme)

      Sets scheme of this request message.
      Parameters:
        `scheme` - The scheme of this request message.
      Since:
        5.0

    - #### getAuthority

          URIAuthority getAuthority()

      Returns authority of this request message.
      Returns:
        the authority or `null`.
      Since:
        5.0

    - #### setAuthority

          void setAuthority(URIAuthority authority)

      Sets authority of this request message.
      Parameters:
        `authority` - The authority of this request message.
      Since:
        5.0

    - #### getRequestUri

          String getRequestUri()

      Returns request URI of this request message. It may be an absolute or relative URI. Applicable to HTTP/1.1 version or earlier.
      Returns:
        the request URI.
      Since:
        5.0

    - #### getUri

          URI getUri()
              throws URISyntaxException

      Returns full request URI of this request message.
      Returns:
        the request URI.
      Throws:
        `URISyntaxException` - Thrown when a string could not be parsed as a URI reference.
      Since:
        5.0

    - #### setUri

          void setUri(URI requestUri)

      Sets the full request URI of this request message.
      Parameters:
        `requestUri` - the request URI.
      Since:
        5.0

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.