Package com.microsoft.playwright
Class Route.FetchOptions
- java.lang.Object
-
- com.microsoft.playwright.Route.FetchOptions
-
-
Field Summary
Fields Modifier and Type Field Description Map<String,String>
headers
If set changes the request HTTP headers.Integer
maxRedirects
Maximum number of request redirects that will be followed automatically.Integer
maxRetries
Maximum number of times network errors should be retried.String
method
If set changes the request method (e.g.Object
postData
If set changes the post data of request.Double
timeout
Request timeout in milliseconds.String
url
If set changes the request URL.
-
Constructor Summary
Constructors Constructor Description FetchOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Route.FetchOptions
setHeaders(Map<String,String> headers)
If set changes the request HTTP headers.Route.FetchOptions
setMaxRedirects(int maxRedirects)
Maximum number of request redirects that will be followed automatically.Route.FetchOptions
setMaxRetries(int maxRetries)
Maximum number of times network errors should be retried.Route.FetchOptions
setMethod(String method)
If set changes the request method (e.g.Route.FetchOptions
setPostData(byte[] postData)
If set changes the post data of request.Route.FetchOptions
setPostData(String postData)
If set changes the post data of request.Route.FetchOptions
setTimeout(double timeout)
Request timeout in milliseconds.Route.FetchOptions
setUrl(String url)
If set changes the request URL.
-
-
-
Field Detail
-
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 to20
. Pass0
to not follow redirects.
-
maxRetries
public Integer maxRetries
Maximum number of times network errors should be retried. Currently onlyECONNRESET
error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to0
- no retries.
-
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 to30000
(30 seconds). Pass0
to disable timeout.
-
url
public String url
If set changes the request URL. New URL must have same protocol as original one.
-
-
Method Detail
-
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 to20
. Pass0
to not follow redirects.
-
setMaxRetries
public Route.FetchOptions setMaxRetries(int maxRetries)
Maximum number of times network errors should be retried. Currently onlyECONNRESET
error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to0
- no retries.
-
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 to30000
(30 seconds). Pass0
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.
-
-