From a9159baa1d6dc9763151b57cb5db8d8e578fdd54 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Fri, 25 Aug 2023 07:20:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20curl=5Frequest=5Fexample.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- curl_request_example.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/curl_request_example.md b/curl_request_example.md index b9412e7..98d076b 100644 --- a/curl_request_example.md +++ b/curl_request_example.md @@ -7,4 +7,24 @@ `curl 'http://localhost:8088?foo=bar&bin=go'` ## Send POST data -`curl -d "foo=bar&bin=go" http://localhost:8088` \ No newline at end of file + +`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 https://my-test-api.com/endpoint1` + +