feat: update types.d.ts

This commit is contained in:
Kuba Janik 2024-08-13 17:47:53 +02:00
parent 8b29b0619e
commit 2c6eec35c0

View file

@ -16672,12 +16672,24 @@ export interface APIRequestContext {
* Request parameters can be configured with `params` option, they will be serialized into the URL search parameters: * Request parameters can be configured with `params` option, they will be serialized into the URL search parameters:
* *
* ```js * ```js
* // Passing params as object
* await request.get('https://example.com/api/getText', { * await request.get('https://example.com/api/getText', {
* params: { * params: {
* 'isbn': '1234', * 'isbn': '1234',
* 'page': 23, * 'page': 23,
* } * }
* }); * });
*
* // Passing params as URLSearchParams
* const searchParams = new URLSearchParams();
* searchParams.set('isbn', '1234');
* searchParams.append('page', 23);
* searchParams.append('page', 24);
* await request.get('https://example.com/api/getText', { params: searchParams });
*
* // Passing params as string
* const queryString = 'isbn=1234&page=23&page=24';
* await request.get('https://example.com/api/getText', { params: queryString });
* ``` * ```
* *
* @param url Target URL. * @param url Target URL.