Class HttpRequest

java.lang.Object
akka.http.javadsl.model.HttpRequest
All Implemented Interfaces:
HttpMessage, HttpMessage.MessageTransformations<HttpRequest>
Direct Known Subclasses:
HttpRequest

public abstract class HttpRequest extends Object implements HttpMessage, HttpMessage.MessageTransformations<HttpRequest>
Represents an Http request.
  • Constructor Details

    • HttpRequest

      public HttpRequest()
  • Method Details

    • method

      public abstract HttpMethod method()
      Returns the Http method of this request.
    • getUri

      public abstract Uri getUri()
      Returns the Uri of this request.
    • entity

      public abstract RequestEntity entity()
      Returns the entity of this request.
      Specified by:
      entity in interface HttpMessage
    • withMethod

      public abstract HttpRequest withMethod(HttpMethod method)
      Returns a copy of this instance with a new method.
    • withUri

      public abstract HttpRequest withUri(Uri relativeUri)
      Returns a copy of this instance with a new Uri.
    • withUri

      public abstract HttpRequest withUri(String path)
      Returns a copy of this instance with a new Uri.
    • withEntity

      public abstract HttpRequest withEntity(RequestEntity entity)
      Returns a copy of this instance with a new entity.
      Specified by:
      withEntity in interface HttpMessage.MessageTransformations<HttpRequest>
    • create

      public static HttpRequest create()
      Returns a default request to be modified using the `withX` methods.
    • create

      public static HttpRequest create(String uri)
      Returns a default request to the specified URI to be modified using the `withX` methods.
    • GET

      public static HttpRequest GET(String uri)
      A default GET request to be modified using the `withX` methods.
    • POST

      public static HttpRequest POST(String uri)
      A default POST request to be modified using the `withX` methods.
    • PUT

      public static HttpRequest PUT(String uri)
      A default PUT request to be modified using the `withX` methods.
    • DELETE

      public static HttpRequest DELETE(String uri)
      A default DELETE request to be modified using the `withX` methods.
    • HEAD

      public static HttpRequest HEAD(String uri)
      A default HEAD request to be modified using the `withX` methods.
    • PATCH

      public static HttpRequest PATCH(String uri)
      A default PATCH request to be modified using the `withX` methods.
    • OPTIONS

      public static HttpRequest OPTIONS(String uri)
      A default OPTIONS request to be modified using the `withX` methods.