Обновить curl_request_example.md
This commit is contained in:
parent
a0a12b2c59
commit
a9159baa1d
|
@ -7,4 +7,24 @@
|
||||||
`curl 'http://localhost:8088?foo=bar&bin=go'`
|
`curl 'http://localhost:8088?foo=bar&bin=go'`
|
||||||
|
|
||||||
## Send POST data
|
## 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`
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue