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

apirequest/methods

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

APIRequest.newContext() method

APIRequest.newContext() is an async method available since v1.16 that creates new instances of APIRequestContext. It returns an APIRequestContext.

APIRequest.newContext() options

APIRequest.newContext() accepts the following options: - clientCertificates (since v1.46, type not specified) - userAgent (since v1.16, type not specified) - extraHTTPHeaders (since v1.16, type not specified) - failOnStatusCode (boolean, since v1.51): Whether to throw on response codes other than 2xx and 3xx. Default is false (response object returned for all status codes). - httpCredentials (since v1.16, type not specified) - proxy (since v1.16, type not specified) - ignoreHTTPSErrors (since v1.16, type not specified) - maxRedirects (int, since v1.52): Maximum number of request redirects to follow automatically. Defaults to 20. Pass 0 to not follow redirects. Can be overwritten per request. - timeout (float, since v1.16): Maximum time in milliseconds to wait for response. Defaults to 30000 (30 seconds). Pass 0 to disable timeout. - baseURL (string, since v1.16): Used for building URLs via URL() constructor for methods like APIRequestContext.get(). - storageState (since v1.16): Populates context with given storage state. Can be a path to file or object with cookies and origins.

storageState option structure for JS/Python

The storageState option for APIRequest.newContext() (JS and Python) accepts either a path string or an object with the following structure: cookies: Array of objects with properties: - name (string, required) - value (string, required) - domain (string) - path (string) - expires (float, Unix time in seconds) - httpOnly (boolean) - secure (boolean) - sameSite (SameSiteAttribute: "Strict"|"Lax"|"None") origins: Array of objects with properties: - origin (string, required) - localStorage: Array of objects with properties: - name (string, required) - value (string, required)

storageState option for Java/C#

The storageState option for APIRequest.newContext() (Java and C# only) is a string type and can be either a path to a file with saved storage or a value returned by BrowserContext.storageState() or APIRequestContext.storageState() methods.

baseURL examples for APIRequest.newContext()

When using baseURL in APIRequest.newContext(), URLs are built using the URL() constructor: - baseURL "http://localhost:3000" with request to "/bar.html" results in "http://localhost:3000/bar.html" - baseURL "http://localhost:3000/foo/" with request to "./bar.html" results in "http://localhost:3000/foo/bar.html" - baseURL "http://localhost:3000/foo" (no trailing slash) with request to "./bar.html" results in "http://localhost:3000/bar.html"

Request.timing() return type

Request.timing() returns an object with properties: startTime (float) - Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC, domainLookupStart (float) - milliseconds relative to startTime, -1 if not available, domainLookupEnd (float) - milliseconds relative to startTime, -1 if not available, connectStart (float) - milliseconds relative to startTime, -1 if not available, secureConnectionStart (float) - milliseconds relative to startTime, -1 if not available, connectEnd (float) - milliseconds relative to startTime, -1 if not available, requestStart (float) - milliseconds relative to startTime, -1 if not available, responseStart (float) - milliseconds relative to startTime, -1 if not available, responseEnd (float) - milliseconds relative to startTime, -1 if not available.

Give your agent this brain