Package com.microsoft.playwright.impl
Class RequestOptionsImpl
java.lang.Object
com.microsoft.playwright.impl.RequestOptionsImpl
- All Implemented Interfaces:
RequestOptions
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Object(package private) Boolean(package private) FormDataImpl(package private) Boolean(package private) Integer(package private) String(package private) FormDataImpl(package private) Double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetData(byte[] data) Sets the request's post data.Sets the request's post data.Sets the request's post data.setFailOnStatusCode(boolean failOnStatusCode) ProvidesFormDataobject that will be serialized as html form usingapplication/x-www-form-urlencodedencoding and sent as this request body.Sets an HTTP header to the request.setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) setMaxRedirects(int maxRedirects) Changes the request method (e.g.setMultipart(FormData form) ProvidesFormDataobject that will be serialized as html form usingmultipart/form-dataencoding and sent as this request body.setQueryParam(String name, boolean value) Adds a query parameter to the request URL.setQueryParam(String name, int value) Adds a query parameter to the request URL.setQueryParam(String name, String value) Adds a query parameter to the request URL.private RequestOptionssetQueryParamImpl(String name, Object value) setTimeout(double timeout) Sets request timeout in milliseconds.
-
Field Details
-
params
-
method
String method -
headers
-
data
Object data -
form
FormDataImpl form -
multipart
FormDataImpl multipart -
failOnStatusCode
Boolean failOnStatusCode -
ignoreHTTPSErrors
Boolean ignoreHTTPSErrors -
timeout
Double timeout -
maxRedirects
Integer maxRedirects
-
-
Constructor Details
-
RequestOptionsImpl
public RequestOptionsImpl()
-
-
Method Details
-
setHeader
Description copied from interface:RequestOptionsSets an HTTP header to the request. This header will apply to the fetched request as well as any redirects initiated by it.- Specified by:
setHeaderin interfaceRequestOptions- Parameters:
name- Header name.value- Header value.
-
setData
Description copied from interface:RequestOptionsSets the request's post data.- Specified by:
setDatain interfaceRequestOptions- Parameters:
data- Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string andcontent-typeheader will be set toapplication/jsonif not explicitly set. Otherwise thecontent-typeheader will be set toapplication/octet-streamif not explicitly set.
-
setData
Description copied from interface:RequestOptionsSets the request's post data.- Specified by:
setDatain interfaceRequestOptions- Parameters:
data- Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string andcontent-typeheader will be set toapplication/jsonif not explicitly set. Otherwise thecontent-typeheader will be set toapplication/octet-streamif not explicitly set.
-
setData
Description copied from interface:RequestOptionsSets the request's post data.- Specified by:
setDatain interfaceRequestOptions- Parameters:
data- Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string andcontent-typeheader will be set toapplication/jsonif not explicitly set. Otherwise thecontent-typeheader will be set toapplication/octet-streamif not explicitly set.
-
setForm
Description copied from interface:RequestOptionsProvidesFormDataobject that will be serialized as html form usingapplication/x-www-form-urlencodedencoding and sent as this request body. If this parameter is specifiedcontent-typeheader will be set toapplication/x-www-form-urlencodedunless explicitly provided.- Specified by:
setFormin interfaceRequestOptions- Parameters:
form- Form data to be serialized as html form usingapplication/x-www-form-urlencodedencoding and sent as this request body.
-
setMethod
Description copied from interface:RequestOptions- Specified by:
setMethodin interfaceRequestOptions- Parameters:
method- Request method, e.g. POST.
-
setMultipart
Description copied from interface:RequestOptionsProvidesFormDataobject that will be serialized as html form usingmultipart/form-dataencoding and sent as this request body. If this parameter is specifiedcontent-typeheader will be set tomultipart/form-dataunless explicitly provided.- Specified by:
setMultipartin interfaceRequestOptions- Parameters:
form- Form data to be serialized as html form usingmultipart/form-dataencoding and sent as this request body.
-
setQueryParam
Description copied from interface:RequestOptionsAdds a query parameter to the request URL.- Specified by:
setQueryParamin interfaceRequestOptions- Parameters:
name- Parameter name.value- Parameter value.
-
setQueryParam
Description copied from interface:RequestOptionsAdds a query parameter to the request URL.- Specified by:
setQueryParamin interfaceRequestOptions- Parameters:
name- Parameter name.value- Parameter value.
-
setQueryParam
Description copied from interface:RequestOptionsAdds a query parameter to the request URL.- Specified by:
setQueryParamin interfaceRequestOptions- Parameters:
name- Parameter name.value- Parameter value.
-
setQueryParamImpl
-
setTimeout
Description copied from interface:RequestOptionsSets request timeout in milliseconds. Defaults to30000(30 seconds). Pass0to disable timeout.- Specified by:
setTimeoutin interfaceRequestOptions- Parameters:
timeout- Request timeout in milliseconds.
-
setFailOnStatusCode
- Specified by:
setFailOnStatusCodein interfaceRequestOptions- Parameters:
failOnStatusCode- Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
-
setIgnoreHTTPSErrors
- Specified by:
setIgnoreHTTPSErrorsin interfaceRequestOptions- Parameters:
ignoreHTTPSErrors- Whether to ignore HTTPS errors when sending network requests.
-
setMaxRedirects
- Specified by:
setMaxRedirectsin interfaceRequestOptions- Parameters:
maxRedirects- Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded. Defaults to20. Pass0to not follow redirects.
-