doc(overrides): remove "one of" that was misleading (#4168)

This commit is contained in:
Pavel Feldman 2020-10-18 23:03:07 -07:00 коммит произвёл GitHub
Родитель 7103887bb5
Коммит ef3d3ca58e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -3963,7 +3963,7 @@ Whenever a network route is set up with [page.route(url, handler)](#pagerouteurl
Aborts the route's request.
#### route.continue([overrides])
- `overrides` <[Object]> Optional request overrides, which can be one of the following:
- `overrides` <[Object]> Optional request overrides, can override following properties:
- `method` <[string]> If set changes the request method (e.g. GET or POST)
- `postData` <[string]|[Buffer]> If set changes the post data of request
- `headers` <[Object]<[string], [string]>> If set changes the request HTTP headers. Header values will be converted to a string.

Просмотреть файл

@ -67,6 +67,19 @@ it('should amend post data', async ({page, server}) => {
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo');
});
it('should amend method and post data', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.route('**/*', route => {
route.continue({ method: 'POST', postData: 'doggo' });
});
const [serverRequest] = await Promise.all([
server.waitForRequest('/sleep.zzz'),
page.evaluate(() => fetch('/sleep.zzz', { method: 'GET' }))
]);
expect(serverRequest.method).toBe('POST');
expect((await serverRequest.postBody).toString('utf8')).toBe('doggo');
});
it('should amend utf8 post data', async ({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.route('**/*', route => {