Class Route.FetchOptions

java.lang.Object
com.microsoft.playwright.Route.FetchOptions
Enclosing interface:
Route

public static class Route.FetchOptions extends Object
  • Field Details

    • headers

      public Map<String,String> headers
      If set changes the request HTTP headers. Header values will be converted to a string.
    • maxRedirects

      public Integer maxRedirects
      Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded. Defaults to 20. Pass 0 to not follow redirects.
    • method

      public String method
      If set changes the request method (e.g. GET or POST).
    • postData

      public Object postData
      If set changes the post data of request.
    • timeout

      public Double timeout
      Request timeout in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
    • url

      public String url
      If set changes the request URL. New URL must have same protocol as original one.
  • Constructor Details

    • FetchOptions

      public FetchOptions()
  • Method Details

    • setHeaders

      public Route.FetchOptions setHeaders(Map<String,String> headers)
      If set changes the request HTTP headers. Header values will be converted to a string.
    • setMaxRedirects

      public Route.FetchOptions setMaxRedirects(int maxRedirects)
      Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded. Defaults to 20. Pass 0 to not follow redirects.
    • setMethod

      public Route.FetchOptions setMethod(String method)
      If set changes the request method (e.g. GET or POST).
    • setPostData

      public Route.FetchOptions setPostData(String postData)
      If set changes the post data of request.
    • setPostData

      public Route.FetchOptions setPostData(byte[] postData)
      If set changes the post data of request.
    • setTimeout

      public Route.FetchOptions setTimeout(double timeout)
      Request timeout in milliseconds. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
    • setUrl

      public Route.FetchOptions setUrl(String url)
      If set changes the request URL. New URL must have same protocol as original one.