diff --git a/docs/README.md b/docs/README.md index ed315370..532cdd2d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -256,7 +256,53 @@ Which looks similar to the actual `Request-Line` that is sent: DELETE /delete HTTP/1.1 ``` -When the `METHOD` argument is omitted from the command, HTTPie defaults to either `GET` (with no request data) or `POST` (with request data). +In addition to the standard methods (`GET`, `POST`, `HEAD`, `PUT`, `PATCH`, `DELETE`, etc.), you can use custom method names, for example: + + +```bash +$ http AHOY pie.dev/post +``` + +There are no restrictions regarding which request methods can include a body. You can send an empty `POST` request: + +```bash +$ http POST pie.dev/post +``` + +You can also make `GET` requests contaning a body: + +```bash +$ http GET pie.dev/get hello=world +``` + +### Optional `GET` and `POST` + +The `METHOD` argument is optional, and when you don’t specify it, HTTPie defaults to: + +* `GET` for requests without a body +* `POST` for requests with body + +Here we don’t specify any request data, so both commands will send the same `GET` request: + +```bash +$ http GET pie.dev/get +``` + +```bash +$ http pie.dev/get +``` + +Here, on the other hand, we do have some data, so both commands will make the same `POST` request: + +``` +$ http POST pie.dev/post hello=world +``` + +```bash +$ http pie.dev/post hello=world +``` + + ## Request URL