curl是利用URL语法在命令行方式下工作的开源文件传输工具

curl命令可以在开发web应用时,模拟前端发起的HTTP请求

1.下载curl

https://curl.haxx.se/download.html

我选择的,Windows 64 bit 7.65.3 binary the curl project,curl-7.65.3_1-win64-mingw.zip

2.解压

  curl-7.65.3_1-win64-mingw

3.设置环境变量

set PATH=E:\software\curl-7.65.3_1-win64-mingw\bin;%PATH%

4.配置IntelliJ IDEA

file——>settings——>Terminal

5.使用,打开

测试:

E:\software\curl-7.65.3_1-win64-mingw\bin>curl baidu.com

<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>

-i 详细信息

E:\software\curl-7.65.3_1-win64-mingw\bin>curl -i baidu.com

HTTP/1.1 200 OK
Date: Mon, 02 Sep 2019 06:11:13 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Tue, 03 Sep 2019 06:11:13 GMT
Connection: Keep-Alive
Content-Type: text/html

<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>

E:\software\curl-7.65.3_1-win64-mingw\bin>curl localhost:/find

[{"id":1,"name":"111"},{"id":2,"name":"222"},{"id":33,"name":"abc"},{"id":34,"name":"xyz"},{"id":65,"name":"abc"},{"id":66,"name":"xyz"}]

E:\software\curl-7.65.3_1-win64-mingw\bin>curl -i localhost:/find

HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 02 Sep 2019 06:13:16 GMT

[{"id":1,"name":"111"},{"id":2,"name":"222"},{"id":33,"name":"abc"},{"id":34,"name":"xyz"},{"id":65,"name":"abc"},{"id":66,"name":"xyz"}]

模拟formdata数据

E:\software\curl-7.65.3_1-win64-mingw\bin>curl  localhost:/api/getPost -X POST  --data "id=1&name=abc"

{"id":1,"name":"abc","other":null,"string":" id=1 name=abc other=null"}

json数据

E:\software\curl-7.65.3_1-win64-mingw\bin>curl localhost:/api/getPostJson  -X POST  -H "Content-Type:application/json"   --data "{\"id\":\"1\",\"name\":\"abc\",\"other\":\"\"}"

{"id":1,"name":"abc","other":"","string":" id=1 name=abc other="}

win7下IntelliJ IDEA使用curl的更多相关文章

  1. Win7下Intellij开发Scala环境搭建

    1.Scala下载并安装 1.Scala的安装时需要依赖JDK的,目前我的电脑上,jdk是已经安装好了,这里就不再说明 2.在地址http://www.scala-lang.org/download/ ...

  2. WIN7下PHP无法开启CURL,终极解决方案

    常规做法: 1)extension=php_curl.dll之外 2)把libeay32.dll.ssleay32.dll.php_curl.dll复制到C:\Windows\SysWOW64目录下 ...

  3. 解决win7 下 curl无法加载的问题

    最近分别在WIN7和Windows8 上分别安装php 高版本!都遇到了这个问题! 一.win7系统64位, apache2.2, php 5.35 vc6 版本 这个比较容易: 1. phpinfo ...

  4. Win7下安装配置gVim

    本文根据vim官网的<Simple Steps to Help You Install gVim on Windows 7>[1]一文整理而成. 1. 下载gVim 在http://www ...

  5. 解决Win7下运行php Composer出现SSL报错的问题

    以前都在linux环境使用php composer.今天尝试在win7下运行composer却出现SSL报错: D:\data\www\mmoyu\symapp>php -f %phprc%\c ...

  6. win8和win7下解决php5.3和5.4、5.5等不能加载php_curl.dll的终极解决办法 收藏

    win8和win7下解决php5.3和5.4.5.5等不能加载php_curl.dll的终极解决办法 收藏2015年01月11日 最近分别在WIN7和Windows8 上分别安装php 高版本!都遇到 ...

  7. (转载+新增)Win7下安装配置gVim

    转载自 http://www.cnblogs.com/zhcncn/p/4151701.html.而后安装过程中加入自己遇到的问题解决方案. 本文根据vim官网的<Simple Steps to ...

  8. win7下利用ftp实现华为路由器的上传和下载

    win7下利用ftp实现华为路由器的上传和下载 1.  Win7下ftp的安装和配置 (1)开始->控制面板->程序->程序和功能->打开或关闭Windows功能 (2)在Wi ...

  9. QC在win7下不能访问QC服务器介绍

    本地访问不了服务器QC的主要几个原因总结 服务器serverjbossextensionhpcmd 2016-03-24   兼容性问题: 1.在服务端QC的安装目录下jboss\server\def ...

随机推荐

  1. iis7设置http跳转https实测可用

    前面ytkah和大家聊了Apache设置http如何301到https,现在我们说说iis7设置http跳转https,因为还是有很多人在用iis服务器.首先要先安装url rewrite modul ...

  2. iOS GPU、cpu、显示器的协作

    在 iOS 系统中,图像内容展示到屏幕的过程需要 CPU 和 GPU 共同参与. CPU 负责计算显示内容,比如视图的创建.布局计算.图片解码.文本绘制等. 随后 CPU 会将计算好的内容提交到 GP ...

  3. 解决node.js链接数据库时出现的报错 --- client does not support authentication

    打开mysql数据库小黑屏 然后输入 mysql> alter user 'root'@'localhost' identified with mysql_native_password by ...

  4. Windows10 Docker镜像加速

    https://dockerhub.azk8s.cn #Azure 中国镜像 https://reg-mirror.qiniu.com #七牛云加速器 https://registry.docker- ...

  5. 【C/C++】指针

    指针定义 指针是一个变量,其值为另一个变量的地址,即,内存位置的直接地址.就像其他变量或常量一样,必须在使用指针存储其他变量地址之前,对其进行声明.指针变量声明的一般形式为: type *var-na ...

  6. 在windbg调试会话中查找.NET版本

    如何在调试会话中找到调试对象中使用的.NET运行时版本?以自动/脚本方式,不使用调试器扩展或符号? 答案: !for_each_module .if ( ($sicmp( "@#Module ...

  7. 【ARC098F】Donation

    [ARC098F]Donation 题面 atcoder 题意: 给定一张\(n\)个点,\(m\)条边的无向图.这张图的每个点有两个权值 \(a_i,b_i\). 你将会从这张图中选出一个点作为起点 ...

  8. sql 将字符串转化为table

    /* *参数说明: 第一个参数为要转化的字符串,第二个参数为字符串中间的分隔符 */ ),)) )) as begin ) set @SourceSql=@SourceSql+@StrSeprate ...

  9. ubuntu之路——day17.4 卷积神经网络示例

    以上是一个识别手写数字的示例 在这个示例中使用了两个卷积-池化层,三个全连接层和最后的softmax输出层 一般而言,CNN的构成就是由数个卷积层紧跟池化层再加上数个全连接层和输出层来构建网络. 在上 ...

  10. Netty通信网络参数配置

    Netty服务端/客户端网络通信过程中常用的参数: Name Associated setter method "writeBufferHighWaterMark" 默认64 * ...