简体   繁体   English

默认设置HTTP header为Postman上的所有请求

[英]Set HTTP header to all requests on Postman by default

How to configure Postman to send Content-Type: application/json header on every request如何配置Postman在每次请求时发送Content-Type: application/json header

I found the following solution in a blogpost post which consists of adding a pre-request script to my collections/folder/request .我在一篇博文中找到了以下解决方案,其中包括将预请求脚本添加到我的collections/folder/request中。

pm.request.headers.add({
    key: "Accept",
    value: "application/json"
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM