curl POST如何查看响应的Header(转)
curl -I 这样其实发送是HEAD请求。
下面这样发送POST请求(-X POST),同时指定Basic认证用户名密码(-u ‘andy:andy’),同时指定数据类型(-H ‘Content-Type: application/json’),以及发送的数据(–data ‘xxxx’)。同时将response的Header打印到控制台(-D -)。
curl 'http://127.0.0.1/test' -X POST -u 'andy:andy'
-H 'Content-Type: application/json'
--data '{"username":"test", "password": "test"}' -D -
curl -D 表示
-D, --dump-header FILE Write the received headers to FILE
下面命令中最后一个横线表示把当前终端当作文件输出。
curl -D -
参考原文:https://blog.csdn.net/hxg117/article/details/88351158 作者:Andy__Han
-----------------------------------------------------------------------------------------------------------

curl -X POST 'Content-Type: application/json' --header 'Accept: */*' 'http://127.0.0.1:8080/jweb/user/apilogin?username=wenbin.ouyang@amberaigroup.com&password=xxx'
curl POST如何查看响应的Header(转)的更多相关文章
- 【转载】curl 模拟 GET\POST 请求,curl查看响应头 以及 curl post 上传文件
补充说明:curl查看响应头 curl -I "http://www.baidu.com"HTTP/1.1 200 OK #HTTP协议 HTTP 返回码Server: Tengi ...
- VS2008 C++ 利用WinHttp API获取Http请求/响应头部Header
http://www.cnblogs.com/LCCRNblog/p/3833472.html 这一篇博客中,实现了获取http请求/响应后的html源码,现在需要获取http请求/响应的头部Head ...
- Postman使用手册1——导入导出和发送请求查看响应
导读: 现在的web和移动开发,常常会调用服务器提供restful接口进行数据请求,为了调试,一般会先用工具进行测试,通过测试后才开始在开发中使用.这里介绍一下如何在chrome浏览器利用postma ...
- Jmeter查看结果树之查看响应的13种方法[详解]
查看结果树查看响应有哪几种方法,可通过左侧面板底部的下拉框选择 1.Text 查看结果树中请求的默认格式为text,会显示请求的取样器结果.请求.响应数据3个部分内容. 取样器结果: 默认Raw视图, ...
- jmeter 查看结果树之查看响应的13种方法
查看结果树查看响应有哪几种方法,可通过左侧面板底部的下拉框选择 1 Text 查看结果树中请求的默认格式为Text,显示取样器结果.请求.响应数据3个部分内容. 取样器结果: 默认Raw展示,可以切换 ...
- Postman 的基本功能按钮解释、发送post请求及get请求、查看响应信息
一.界面功能按钮: 二.postman模拟发送post请求: 三.postman模拟get请求: 选择请求类型-->输入请求URL-->点击send发送 四.查看响应信息
- php CURL 请求头和响应头获取
1.从CURL中获取响应头 $oCurl = curl_init(); // 设置请求头, 有时候需要,有时候不用,看请求网址是否有对应的要求 $header[] = "Content-ty ...
- 【转帖】客户端通过 HTTP 请求和响应 的 Header 信息总结
请求Header原帖地址:http://technique-digest.iteye.com/blog/1174581 响应Header原帖地址:http://blog.pfan.cn/hurongl ...
- postman使用之三:API请求和查看响应结果
请求 postman支持很多请求类型,界面左侧可以看到请求类型:get.post.put.patch等,右侧是发送和保存按钮,下方是请求支持的认证方式.信息头.信息体.私有脚本和测试结果.下面我们介绍 ...
随机推荐
- 【VS开发】模态对话框和非模态对话框
MFC中对话框有两种形式,一个是模态对话框(model dialog box),一个是非模态对话框(modeless dialog box). 一.模态对话框(model dialog box) 在程 ...
- c++工厂模式和多线程结合
void a::create() { Function *f1 = m_functionmanager.CreateFunction(1);Function *f2 = m_functionmanag ...
- AKKA学习(二) 未完
Actor调用 从上面的例子中,我们可以大概的对AKKA在JAVA中的使用有一个全局的概念.这里我们在稍微细致的讲解一下. 在JAVA中使用AKKA进行开发主要有这几个步骤: 定义消息模型. 创建Ac ...
- vue中Runtime-Compiler和Runtime-only的区别
一.选择Runtime-Compiler和Runtime-only不同模式的时候main.js文件的区别 二.vue程序运行过程 1.解析: 第一步,当把vue模板template传给Vue实例 ...
- c#中抽象类和接口的相同点跟区别
下面是自己写的一个demo,体现抽象类和接口的用法. using System; using System.Collections.Generic; using System.Linq; using ...
- laravel框架之批刪&全選&全不選&反選
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Vue源码解读-构造函数
src/core/instance/index.js此文件主要实现了Vue初始化 // 引入模块 import { initMixin } from './init' import { stateMi ...
- 76. Minimum Window Substring (JAVA)
Given a string S and a string T, find the minimum window in S which will contain all the characters ...
- kickstart一键装机部署
1.第一步安装DHCP yum -y install dhcp 1.1配置修改文件 cat >> /etc/dhcp/dhcpd.conf <<END subnet 172.1 ...
- SpringBoot封装自己的Starter
https://juejin.im/post/5cb880c2f265da03981fc031 一.说明 我们在使用SpringBoot的时候常常要引入一些Starter,例如spring-boot- ...