new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · API reference · all subjects

requestoptions/methods

12 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

RequestOptions.create method

RequestOptions.create() is a static method that creates a new instance of RequestOptions. It returns a RequestOptions object and was introduced in v1.18.

RequestOptions.setData method

RequestOptions.setData(data) sets the request's post data. The data parameter accepts string, Buffer, or Serializable types. If the data parameter is an object, it will be serialized to a JSON string and the content-type header will be set to application/json if not explicitly set. Otherwise, the content-type header will be set to application/octet-stream if not explicitly set. Returns RequestOptions. Introduced in v1.18.

RequestOptions.setFailOnStatusCode method

RequestOptions.setFailOnStatusCode(failOnStatusCode) sets whether to throw an exception on response codes other than 2xx and 3xx. The failOnStatusCode parameter is a boolean. By default, the response object is returned for all status codes. Returns RequestOptions. Introduced in v1.18.

RequestOptions.setForm method

RequestOptions.setForm(form) provides a FormData object that will be serialized as an HTML form using application/x-www-form-urlencoded encoding and sent as the request body. If this parameter is specified, the content-type header will be set to application/x-www-form-urlencoded unless explicitly provided. The form parameter is a FormData object. Returns RequestOptions. Introduced in v1.18.

RequestOptions.setHeader method

RequestOptions.setHeader(name, value) sets an HTTP header to the request. This header will apply to the fetched request as well as any redirects initiated by it. The name parameter is a string (header name) and the value parameter is a string (header value). Returns RequestOptions. Introduced in v1.18.

RequestOptions.setIgnoreHTTPSErrors method

RequestOptions.setIgnoreHTTPSErrors(ignoreHTTPSErrors) sets whether to ignore HTTPS errors when sending network requests. The ignoreHTTPSErrors parameter is a boolean. Returns RequestOptions. Introduced in v1.18.

RequestOptions.setMaxRedirects method

RequestOptions.setMaxRedirects(maxRedirects) sets the maximum number of request redirects that will be followed automatically. The maxRedirects parameter is an int. An error will be thrown if the number is exceeded. Defaults to 20. Pass 0 to not follow redirects. Returns RequestOptions. Introduced in v1.26.

RequestOptions.setMaxRetries method

RequestOptions.setMaxRetries(maxRetries) sets the maximum number of times network errors should be retried. The maxRetries parameter is an int. Currently only ECONNRESET error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to 0 (no retries). Returns RequestOptions. Introduced in v1.46.

RequestOptions.setMethod method

RequestOptions.setMethod(method) changes the request method (e.g. PUT or POST). The method parameter is a string (request method name). Returns RequestOptions. Introduced in v1.18.

RequestOptions.setMultipart method

RequestOptions.setMultipart(form) provides a FormData object that will be serialized as an HTML form using multipart/form-data encoding and sent as the request body. If this parameter is specified, the content-type header will be set to multipart/form-data unless explicitly provided. The form parameter is a FormData object. Returns RequestOptions. Introduced in v1.18.

RequestOptions.setQueryParam method

RequestOptions.setQueryParam(name, value) adds a query parameter to the request URL. The name parameter is a string (parameter name) and the value parameter is a string, boolean, or int (parameter value). Returns RequestOptions. Introduced in v1.18.

RequestOptions.setTimeout method

RequestOptions.setTimeout(timeout) sets the request timeout in milliseconds. The timeout parameter is a float (request timeout in milliseconds). Defaults to 30000 (30 seconds). Pass 0 to disable timeout. Returns RequestOptions. Introduced in v1.18.

Give your agent this brain