mirror of
https://codeberg.org/vlw/curl.git
synced 2025-09-13 16:23:41 +02:00
doc: add README.md
This commit is contained in:
parent
3a60df64ee
commit
ee7f36e1c5
1 changed files with 37 additions and 0 deletions
37
README.md
Normal file
37
README.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
A simple curl wrapper written in bash that can be used to make HTTP requests to API endpoints.
|
||||
|
||||

|
||||
*This is how I use this script*
|
||||
|
||||
# Files
|
||||
This script uses separate files for various request options. Create these files in the same directory as `curl.sh`.
|
||||
|
||||
## `params.txt`
|
||||
URL search parameters
|
||||
|
||||
## `paylod.json`
|
||||
JSON request body that will be sent with all requests (except `GET`).
|
||||
|
||||
## `key.txt`
|
||||
[HTTP Authentication Bearer Token](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)
|
||||
|
||||
## `disable_peer_validation`
|
||||
Optional empty file that when present will disable SSL peer validation - for self-signed certificates etc.
|
||||
|
||||
# Make a request
|
||||
Run the `curl.sh` file from your shell and pass it two parametes for URL and request method
|
||||
|
||||
```sh
|
||||
./curl.sh https://example.com GET
|
||||
```
|
||||
|
||||
The response body will be printed to stdout.
|
||||
|
||||
*Example*
|
||||
```
|
||||
vlw@example:/curl$ ./curl.sh https://example.com GET
|
||||
GET https://example.com?foo=bar
|
||||
|
||||
"This is an example response body in plaintext"
|
||||
vlw@example:/curl$
|
||||
```
|
Loading…
Add table
Reference in a new issue