mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(fetch): fix typo (#8991)
This commit is contained in:
parent
2408a5dfb9
commit
e359e95fcc
@ -133,7 +133,7 @@ export abstract class FetchRequest extends SdkObject {
|
|||||||
|
|
||||||
let postData;
|
let postData;
|
||||||
if (['POST', 'PUSH', 'PATCH'].includes(method))
|
if (['POST', 'PUSH', 'PATCH'].includes(method))
|
||||||
postData = params.formData ? serilizeFormData(params.formData, headers) : params.postData;
|
postData = params.formData ? serializeFormData(params.formData, headers) : params.postData;
|
||||||
else if (params.postData || params.formData)
|
else if (params.postData || params.formData)
|
||||||
throw new Error(`Method ${method} does not accept post data`);
|
throw new Error(`Method ${method} does not accept post data`);
|
||||||
if (postData) {
|
if (postData) {
|
||||||
@ -421,7 +421,7 @@ function parseCookie(header: string) {
|
|||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
function serilizeFormData(data: any, headers: { [name: string]: string }): Buffer {
|
function serializeFormData(data: any, headers: { [name: string]: string }): Buffer {
|
||||||
const contentType = headers['content-type'] || 'application/json';
|
const contentType = headers['content-type'] || 'application/json';
|
||||||
if (contentType === 'application/json') {
|
if (contentType === 'application/json') {
|
||||||
const json = JSON.stringify(data);
|
const json = JSON.stringify(data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user