简体   繁体   English

如何在调用API时在Postman上提供用户名和密码

[英]How to provide Username and Password on Postman while calling an API

I tried to call an API from Postman and I give Username and password in authorisation tab in Postman and not working. 我尝试从Postman调用API,并在Postman的“授权”选项卡中提供了用户名和密码,但无法正常工作。

But I can access API data in the browser when I put the URL after successfully login with username and password as shown 但是,使用用户名和密码成功登录后输入URL时,可以在浏览器中访问API数据,如下所示 在此处输入图片说明

So how can I give my credentials to postman to get API data? 那么,如何将我的凭据提供给邮递员以获取API数据?

Can you try to see what parameters it sends when requested via browser? 您能否尝试查看通过浏览器请求时发送的参数?

You can do that in Chrome: 您可以在Chrome中执行以下操作:

  1. Developer tools (Ctrl + Shift + I) 开发人员工具(Ctrl + Shift + I)
  2. Network tab 网络标签
  3. XHR XHR

Then send your request. 然后发送您的请求。 You'll be able to see request headers and body. 您将能够看到请求标头和正文。 Then you can copy the parameters over to your postman call. 然后,您可以将参数复制到邮递员电话中。 Most calls like that are using authorization token. 像这样的大多数呼叫都使用授权令牌。 You'll also be able to see if the token was requested in the separate call and if it was passed as a parameter. 您还可以查看令牌是否在单独的调用中被请求以及是否作为参数传递。

Screenshot 截图

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

相关问题 更改邮递员API中的用户名和密码 - Change username and password in postman API How to hit sonarQube api with username and api token in postman.(bearer token and username password is working Problem with UserName and Api Token) - How to hit sonarQube api with username and api token in postman.(bearer token and username password is working Problem with UserName and Api Token) 如何在 Tests for Postman 中更改用户名密码 - How to change username password in Tests for Postman 在java中调用具有用户名和密码的API - calling API that have username and password in java 如何使用Angular 2连接到需要用户名和密码的API - How to connect to an API that requires a username and password with Angular 2 用户如何通过用户名和密码传递API密钥? - How users pass API key with their username and password? 如何使用 php 使用带有用户名和密码的 API? - How to consume an API with username and password using php? 如何连接需要用户名和密码的 API - How to connect with an API that requires username and password 调用API:如何提供这些参数(键,随机数和签名) - Calling API: How to provide these parameters (key, nonce and signature) 使用用户名和密码访问HipChat API - Accessing the HipChat API With Username and Password
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM