Skip to content

Commit

Permalink
docs: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmirJNR committed Jun 19, 2024
1 parent 559e0ec commit 3859b4a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# gurl (wip)

`curl` but written in `go`

## http requests

`gurl` haves many options to send your http data to servers, you can use the conventional methods:
POST, GET, PUT, PATCH, DELETE, HEAD and OPTIONS

## flags

- --request [POST | GET | PUT | PATCH | DELETE | HEAD | OPTIONS] string
- base identifier of http method request, proceeded by the url
- --header string
- header values to be passed
- --data [string | key=value]
- data values or key/values to be passed,
generally values if json and key/values if form data
- --file key=value
- file field and value to be passed with the form data content type
- --verbose
- tells the application that it should print on the stdout with all content from the response, not only the body

## usage examples

```shell
gurl --request GET {URL}
```

```shell
gurl --request GET {URL} \
--header 'Authorization: bearer {TOKEN}'
```

```shell
gurl --request POST {URL} \
--header 'Content-Type: application/json' \
--header 'Authorization: bearer {TOKEN}' \
--data '{"name": "Almir", "job": "Developer"}'
```

```shell
gurl --request POST {URL} \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: bearer {TOKEN}' \
--data name=Almir \
--data job=Developer \
--data age=23 \
--file genericFile={FILE_PATH} \
--file genericFile2={FILE_PATH_2}
```

0 comments on commit 3859b4a

Please sign in to comment.