I need to create playwright API request with x-www-form-urlencoded body: Example from postman: working postman request example
I was trying to it that way:
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;
But it is not working :/ Could you tell me how can i compose this kind of request in playwright?