Curl

From Leo's Notes
Last edited on 24 August 2023, at 21:46.

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

Pass custom headers

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

See also

  • pcopy - A cool tool written in go that lets you upload/download data from a shared 'clipboard'/paste bin like service