Class HttpRequest

java.lang.Object
org.openqa.selenium.remote.http.HttpRequest

public class HttpRequest extends Object
  • Constructor Details

  • Method Details

    • getUri

      public String getUri()
    • getMethod

      public HttpMethod getMethod()
    • getQueryParameter

      public String getQueryParameter(String name)
      Get a query parameter. The implementation will take care of decoding from the percent encoding.
    • addQueryParameter

      public HttpRequest addQueryParameter(String name, String value)
      Set a query parameter, adding to existing values if present. The implementation will ensure that the name and value are properly encoded.
    • getQueryParameterNames

      public Iterable<String> getQueryParameterNames()
    • getQueryParameters

      public Iterable<String> getQueryParameters(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAttribute

      public Object getAttribute(String key)
      Retrieves a user-defined attribute of this message. Attributes are stored as simple key-value pairs and are not included in a message's serialized form.
      Parameters:
      key - attribute name
      Returns:
      attribute object
    • setAttribute

      public HttpRequest setAttribute(String key, Object value)
    • removeAttribute

      public HttpRequest removeAttribute(String key)
    • getAttributeNames

      public Iterable<String> getAttributeNames()
    • forEachHeader

      public void forEachHeader(BiConsumer<String,String> action)
      Calls the action for all headers set.
      Parameters:
      action - the action to call
    • getHeaderNames

      public Iterable<String> getHeaderNames()
      Returns an iterable with all the names of the headers set.
      Returns:
      an iterable view of the header names
    • getHeaders

      public Iterable<String> getHeaders(String name)
      Returns an iterable of the values of headers with the name (case-insensitive).
      Parameters:
      name - the name of the header, case-insensitive
      Returns:
      an iterable view of the values
    • getHeader

      public String getHeader(String name)
      Returns the value of the first header with the name (case-insensitive).
      Parameters:
      name - the name of the header, case-insensitive
      Returns:
      the value
    • setHeader

      public HttpRequest setHeader(String name, String value)
      Removes all headers with the name (case-insensitive) and adds a header with the value.
      Parameters:
      name - the name of the header, case-insensitive
      value - the value to set
      Returns:
      self
    • addHeader

      public HttpRequest addHeader(String name, String value)
      Adds a header with the name and value, headers with the same (case-insensitive) name will be preserved.
      Parameters:
      name - the name of the header, case-insensitive
      value - the value to set
      Returns:
      self
    • removeHeader

      public HttpRequest removeHeader(String name)
      Removes all headers with the name (case-insensitive).
      Parameters:
      name - the name of the header, case-insensitive
      Returns:
      self
    • getContentEncoding

      public Charset getContentEncoding()
    • setContent

      @Deprecated public HttpRequest setContent(Supplier<InputStream> supplier)
      Deprecated.
    • setContent

      public HttpRequest setContent(Contents.Supplier supplier)
    • getContent

      public Contents.Supplier getContent()