如何使用 Postman 使用 HTTP Basic 调用服务? [英] How do I call a service with HTTP Basic using Postman?

查看:72
本文介绍了如何使用 Postman 使用 HTTP Basic 调用服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 curl 发出请求:

I'm using curl to make a request:

curl -u NL91IOC2RWCM31G1ESWYX:SvCuj0tFQjmclZDFQzdMqfrGZ5Qw5jfKM8 
  -H "Accept: application/json" 
  https://api.stormpath.com/v1/applications/649j4AnLkUMezhYTl61

如何使用 Postman 发出同样的请求?

How do I make this same request using Postman?

推荐答案

curl -u key:secret 使用 HTTP Basic 身份验证发送请求.在 Postman 中很容易做到这一点:

curl -u key:secret sends a request with HTTP Basic authentication. It's easy to do this in Postman:

  1. 在地址字段中输入端点 URL.

  1. 切换到授权选项卡并选择基本身份验证.输入密钥作为用户名和密码作为密码.点击更新请求为请求生成正确的授权标头.
  1. Switch to the Authorization tab and choose Basic Auth. Enter the key as Username and the secret as Password. Click Update Request to generate the proper Authorization header for the request.

  1. 切换到 Headers 选项卡并添加 Accept 标题.
  1. Switch to the Headers tab and add the Accept header.

  1. 发送.

这篇关于如何使用 Postman 使用 HTTP Basic 调用服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆