From 428e000d1109c6cbafe53eb98de44b2bb4ad0dc0 Mon Sep 17 00:00:00 2001 From: Antoine Amara Date: Sat, 22 Oct 2022 23:01:22 +0200 Subject: [PATCH] twurl: add page (#9101) --- pages/common/twurl.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/twurl.md diff --git a/pages/common/twurl.md b/pages/common/twurl.md new file mode 100644 index 000000000..cd2633f99 --- /dev/null +++ b/pages/common/twurl.md @@ -0,0 +1,28 @@ +# twurl + +> Curl-like command but tailored specifically for the Twitter API. +> More information: . + +- Authorize `twurl` to access a Twitter account: + +`twurl authorize --consumer-key {{twitter_api_key}} --consumer-secret {{twitter_api_secret}}` + +- Make a GET request to an API endpoint: + +`twurl -X GET {{twitter_api_endpoint}}` + +- Make a POST request to an API endpoint: + +`twurl -X POST -d '{{endpoint_params}}' {{twitter_api_endpoint}}` + +- Upload media to Twitter: + +`twurl -H "{{twitter_upload_url}}" -X POST "{{twitter_upload_endpoint}}" --file "{{path/to/media.jpg}}" --file-field "media"` + +- Access a different Twitter API host: + +`twurl -H {{twitter_api_url}} -X GET {{twitter_api_endpoint}}` + +- Create an alias for a requested resource: + +`twurl alias {{alias_name}} {{resource}}`