我需要创建一个带有x-www-form-urlencoded格式的请求体的playwright API请求:
来自Postman的示例:
工作的postman请求示例我试图这样做:
async getNewApiAccesToken({request})
{
const postResponse = await request.post("https://login.microsoftonline.com//token",{
ignoreHTTPSErrors: true,
FormData: {
'client_id': 'xyz',
'client_secret': 'xyz',
'grant_type': 'client_credentials',
'scope': 'api://xyz'
}
})
console.log(await postResponse.json());
return postResponse;