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

查看:90
本文介绍了如何使用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身份验证的请求.在邮递员中很容易做到这一点:

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. 切换到标题标签,然后添加接受"标题.
  1. Switch to the Headers tab and add the Accept header.

  1. 发送.

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

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