Обновить curl_request_example.md

This commit is contained in:
mirivlad 2023-08-25 07:20:53 +03:00
parent a0a12b2c59
commit a9159baa1d
1 changed files with 21 additions and 1 deletions

View File

@ -7,4 +7,24 @@
`curl 'http://localhost:8088?foo=bar&bin=go'`
## Send POST data
`curl -d "foo=bar&bin=go" http://localhost:8088`
`curl -d "foo=bar&bin=go" http://localhost:8088`
## Send POST data as JSON
`curl -H 'Content-Type: application/json' --data '{"param1":"test1","param2":"test2"}' http://www.test.com`
## Ignoring bad or self-signed certificates
`curl -k https://localhost/my_test_endpoint`
## Set type of request
`# updating the value of param2 to be test 3 on the record id`
`curl -X 'PUT' -d '{"param1":"test1","param2":"test3"}' \http://test.com/1`
## Request with BasicHTTPAuth
`curl -u <user:password> https://my-test-api.com/endpoint1`