Linux命令发送Http的get或post请求(curl和wget两种方法)
来源:互联网 发布:知乎 电脑下载 编辑:程序博客网 时间:2024/05/21 06:40
Http请求指的是客户端向服务器的请求消息,Http请求主要分为get或post两种,在Linux系统下可以用curl和wget命令来模拟Http的请求。下面就来介绍一下Linux系统如何模拟Http的get或post请求。
一、get请求:
1、使用curl命令:
curl “http://www.baidu.com” 如果这里的URL指向的是一个文件或者一幅图都可以直接下载到本地
curl -i “http://www.baidu.com” 显示全部信息
curl -l “http://www.baidu.com” 只显示头部信息
curl -v “http://www.baidu.com” 显示get请求全过程解析
2、使用wget命令:
wget “http://www.baidu.com”也可以
二、post请求
1、使用curl命令(通过-d参数,把访问参数放在里面):
curl -d “param1=value1¶m2=value2” “http://www.baidu.com”
2、使用wget命令:(--post-data参数来实现)
wget --post-data ‘user=foo&password=bar’ http://www.baidu.com
以上就是Linux模拟Http的get或post请求的方法了,这样一来Linux系统也能向远程服务器发送消息了。
示例:wget --post-data="" http://mcs-inner.99bill.com/mcs-gateway/mcs/task/clear
三、curl (可直接发送格式化请求例如json)
示例:目标url:http://fsc-inner.99bill.com/acs/deposit/{srcRef}
命令:curl -H "Content-type: application/json" -X POST -d '{"srcRef":"1002"}'http://fsc-inner.99bill.com/acs/deposit/1002
- Linux命令发送Http的get或post请求(curl和wget两种方法)
- Linux命令发送Http的get或post请求(curl和wget两种方法)
- linux命令发送http的get或post请求(curl和wget两种方法)
- Linux命令发送Http的get或post请求(curl和wget两种方法)
- Linux 下模拟Http 的get or post请求(curl和wget两种方法)
- Linux 下模拟Http 的get or post请求(curl和wget两种方法)
- Linux 下模拟Http 的get or post请求(curl和wget两种方法)
- linux 使用curl命令发送get和post请求
- curl模拟http发送get或post请求
- Linux下模拟http的get/post请求(curl or wget)
- 使用curl和wget发送post请求
- 发送Http请求(POST GET)的方法
- 发送Http请求(POST GET)的方法
- 发送Http请求(POST GET)的方法
- 发送Http请求(POST GET)的方法
- 发送Http请求(POST GET)的方法
- 发送Http请求(POST GET)的方法
- 发送HTTP请求的方法:GET & POST
- VC++模拟鼠标点击
- Java中的Static关键字
- 链式队列定义以及应用
- 常用性能分析工具之sar、iostat
- Bakery Algorithm的c#实现用于多线程互斥访问临界资源
- Linux命令发送Http的get或post请求(curl和wget两种方法)
- 文件默认权限
- swift中UINavigationController的使用
- java 原码、反码、补码计算 以及 取反(~)运算
- 低电压检测
- P1309瑞士轮
- 14.4.1 Buffer Pool
- Android Studio错误: 非法字符: '\ufeff' 需要class, interface或enum
- Java Web中遇到中文编码乱码问题