邮递员-如何查看带有标头和正文数据并替换了变量的请求 [英] Postman - How to see request with headers and body data with variables substituted

查看:65
本文介绍了邮递员-如何查看带有标头和正文数据并替换了变量的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用



演示环境



1)将鼠标悬停在变量上



2)生成代码按钮/链接



3)邮递员控制台



更新时间:2016-06-03



虽然上述方法确实有效,但实际上,我现在通常使用邮递员请求屏幕上的生成代码链接。无论您选择哪种代码语言,生成的代码都包含替换变量。点击生成代码链接速度更快,此外,您还可以看到替换变量



下面的原始答案



查看替代项标头和正文中的变量,您需要使用Chrome开发者工具。要在Postman中启用Chrome开发者工具,请按照 http: //blog.getpostman.com/2015/06/13/debugging-postman-requests /。



我在上面的链接中复制了说明以防将来链接断开:


  1. 在Chrome URL窗口内键入chrome:// flags


  2. 搜索打包或尝试找到为打包应用程序启用调试


  3. 启用设置


  4. 重启Chrome





您可以通过右键单击Postman内
的任意位置并选择检查元素来访问开发工具窗口。您也可以转到
chrome:// inspect /#apps,然后单击邮递员标题下
requester.html下方的检查。



启用后,您可以在编写测试
脚本时使用网络工具选项卡在您的请求或控制台上获取更多
信息。如果您的测试脚本出了问题,它将在此处显示



I am using the Postman Chrome plugin to invoke HTTP requests for software testing. I use the Environments feature with Environment and Global Variables to substitute variables in my requests headers and body.

The variable substitution is working correctly (I can tell as the responses from the HTTP Server indicate that).

However, I would like to be able to see the Request Header and Body values AFTER the variables have been substituted. How can I do that?

解决方案

Update 2018-12-12 - Chrome App v Chrome Plugin - Most recent updates at top

With the deprecation of the Postman Chrome App, assuming that you are now using the Postman Native App, the options are now:

  1. Hover over variables with mouse
  2. Generate "Code" button/link
  3. Postman Console

See below for full details on each option.

Personally, I still go for 2) Generate "Code" button/link as it allows me to see the variables without actually having to send.

Demo Request

Demo Environment

1) Hover over variables with mouse

2) Generate "Code" button/link

3) Postman Console

Update: 2016-06-03

Whilst the method described above does work, in practice, I now normally use the "Generate Code" link on the Postman Request screen. The generated code, no matter what code language you choose, contains the substituted variables. Hitting the "Generate Code" link is just faster, additionally, you can see the substituted variables without actually making the request.

Original Answer below

To see the substituted variables in the Headers and Body, you need to use Chrome Developer tools. To enable Chrome Developer Tools from within Postman do the following, as per http://blog.getpostman.com/2015/06/13/debugging-postman-requests/.

I have copied the instructions from the link above in case the link gets broken in the future:

  1. Type chrome://flags inside your Chrome URL window

  2. Search for "packed" or try to find the "Enable debugging for packed apps"

  3. Enable the setting

  4. Restart Chrome

You can access the Developer Tools window by right clicking anywhere inside Postman and selecting "inspect element". You can also go to chrome://inspect/#apps and then click "inspect" just below requester.html under the Postman heading.

Once enabled, you can use the Network Tools tab for even more information on your requests or the console while writing test scripts. If something goes wrong with your test scripts, it’ll show up here.

这篇关于邮递员-如何查看带有标头和正文数据并替换了变量的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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