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. appuploader 使用

    mac 使用 Jar Lanucher.app 打开 解压后的 appuploader.jar 文件,即可启动 appuploader. 内容 网址 官方网站 http://www.appupload ...

  2. dart 使用

    用法 说明 print('xxx') 打印 == 比较相等 != 比较不等 语句后面必须加分号

  3. 牛客NOIP暑期七天营-提高组2C:滑块(平衡树) (这里rope骗分)

    A:hash 或者 map 或者trie. #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) usin ...

  4. eclipse 中的注释 快捷键 多行注释快捷键 单行注释快捷键

    Eclipse 中的两种注释方法: (1)多行注释(2)单行注释 一. 多行注释快捷键 1:添加注释Ctrl+Shift+/ :    添加/* */注释 示例:选中代码块后按下快捷键即可 /* fl ...

  5. Spring @Scheduled定时任务的fixedRate,fixedDelay,cron的作用和不同

    一.   三种定时类型. 1.cron  --@Scheduled(cron="0/5 * * * *?") 当时间达到设置的时间会触发事件.上面那个例子会每5秒执行一次. 201 ...

  6. windows jenkins dotnet core 自动化构建webapi

    jenkins环境搭建好 注意一下几点: - 需要安装git - 需要安装dotnet core sdk环境 - 遇到这里报错,提示 Repository URL 错误的话,如果确实没有配置错误,重启 ...

  7. UFUN函数 UF_ATTR函数(UF_ATTR_read_value 函数用法)

    //此函数的功能是输入tag值,返回与属性标题对应的属性值 static string read_attr(tag_t object_tag) { UF_initialize(); ]="零 ...

  8. 全部文章> Maven

    Maven     原 Maven中<resources>标签详解 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;& ...

  9. 洛谷P2312 解方程题解

    洛谷P2312 解方程题解 题目描述 已知多项式方程: \[a_0+a_1x+a_2x^2+\cdots+a_nx^n=0\] 求这个方程在 \([1,m]\) 内的整数解(\(n\) 和 \(m\) ...

  10. 第04组alpha冲刺(2/4)

    队名:斗地组 组长博客:地址 作业博客:Alpha冲刺(2/4) 各组员情况 林涛(组长) 过去两天完成了哪些任务: 1.收集各个组员的进度 2.写博客 展示GitHub当日代码/文档签入记录: 接下 ...