我需要使用 x-www-form-urlencoded 主体创建剧作家 API 请求:来自邮递员的示例: 工作邮递员请求示例
我正在尝试这样做:
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;Run Code Online (Sandbox Code Playgroud)
但它不起作用:/你能告诉我如何在剧作家中撰写这种请求吗?
javascript typescript x-www-form-urlencoded playwright playwright-test