curl

Introduction

Curl 是一个 Unix* 上命令行工具,在大部分发行版中都自带,或者非常容易获取到。

Usage

  • 基本使用
1
curl https://domain.com
  • 指定请求类型
1
curl -X POST https://domain.com
  • 设置 Header
1
curl -X POST -H "Content-Type:application/json" -X POST -d {'user': 'username'} https://domain.com
  • URL 转义
1
curl --data-urlencode "msg=hello@world" https://domain.com

Reference