Curl

From Leo's Notes
Revision as of 22:00, 14 June 2020 by Leo (talk | contribs)
This page was last edited on 14 June 2020, at 22:00.

Quick Usage

POST data

## A Post request
$ curl --data "" https://api.leo.leung.xyz/recent
$ curl -X POST https://api.leo.leung.xyz/recent
$ curl --request POST https://api.leo.leung.xyz/recent

## Post data
$ curl --data "client_id=75&secret=xyz" https://api.leo.leung.xyz/recent

## Multipart data
$ curl --form "client_id=75&secret=xyz&file=@filename.txt" https://api.leo.leung.xyz/recent

Headers

$ curl -H "Custom-Header: True" https://api.leo.leung.xyz/recent