[英]What is the syntax to send an HTTP POST request with a bearer token with it?
let requestOptionsStep5 = {
'hostname': auth,
'method': 'GET',
'path': `16ac1a91f529`,
'port': 443,
'protocol': 'https:'
};
I want to send a POST request to the auth server and I don't know where to pass the bearer token and its value to it.我想向身份验证服务器发送一个 POST 请求,但我不知道将不记名令牌及其值传递给它的位置。
Usually, it needs to be passed in the header like this: enter image description here通常,它需要像这样在 header 中传递:在此处输入图像描述
Simple way to add Bearer Token
to request in POSTMAN:在 POSTMAN 中添加
Bearer Token
以请求的简单方法:
Authorization
tab of your request;Authorization
选项卡;Bearer Token
in our case); Bearer Token
);Token
input.Token
输入中插入您的令牌。 It will add header to your request automatically :它会自动将 header 添加到您的请求中:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.