Curl

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

Quick usage[edit | edit source]

POST data[edit | edit source]

## 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[edit | edit source]

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

See also[edit | edit source]

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