在postman pre脚本中发送Post请求
我试图使用postman在预脚本中发送POST请求,但出现错误“评估预请求脚本时出错:错误:意外标记”指定在postman pre脚本中发送Post请求,postman,postman-pre-request-script,Postman,Postman Pre Request Script,我试图使用postman在预脚本中发送POST请求,但出现错误“评估预请求脚本时出错:错误:意外标记”指定标题的键不正确 应该是: 标题:{“内容类型”:“应用程序/json”}- 你需要从你的代码中删除s。你如何尝试标题:{“内容类型”:“应用程序/json”}-从你的代码中删除s。@DannyDainton谢谢你指出这一点。现在可以开始了。保存我的一天。添加了答案,这样你就可以接受并结束问题了。 pm.sendRequest({ url: 'http://localhost:8001/rou
标题的键不正确
应该是:
标题:{“内容类型”:“应用程序/json”}
-
你需要从你的代码中删除s
。你如何尝试标题:{“内容类型”:“应用程序/json”}
-从你的代码中删除s
。@DannyDainton谢谢你指出这一点。现在可以开始了。保存我的一天。添加了答案,这样你就可以接受并结束问题了。
pm.sendRequest({
url: 'http://localhost:8001/routes/d6b7a95a-fd91-4f8a-b8f6-10835f30170a',
method: 'PATCH',
headers: {"Content-Type": "application/json"},
body: {
mode: 'raw',
raw:JSON.stringify({
"protocols":["http","https"],
"paths":["/target-paymentoriginal"],
"methods":[]})} },
function (err, response) { console.log("Updated original route to target-payment"+response.json()); });