Last active
June 4, 2024 19:39
-
-
Save karlpokus/a2198c575a7a368d0bb26a08bbf876f0 to your computer and use it in GitHub Desktop.
bash curl API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# simple GET | |
curl <url> | |
# POST w json | |
curl -X POST -H "Content-Type: application/json" -d '{"data":"POST with json"}' <url> | |
# POST w urlencoded | |
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'foo=1&boo=2' <url> | |
# curl file | |
curl -F filedata=@<filename> <url> | |
# curl file w header | |
curl -F filedata=@<filename> -H "Content-Type: multipart/form-data" <url> | |
# to curl @cloud9 | |
# set application link to public under share | |
# https://community.c9.io/t/run-curl-request-uppon-a-node-js-server/8047/2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment