CURL: Difference between revisions
Jump to navigation
Jump to search
Line 147: | Line 147: | ||
| valign="top" | | | valign="top" | | ||
* [https://stackoverflow.com/questions/43054195/ cURL » Post Raw Body Data] | |||
* [https://stackoverflow.com/questions/12583930/ cURL » Use Standard Input] | |||
|- | |- |
Revision as of 03:11, 20 April 2024
sudo apt update sudo apt install curl && curl --version
Playground
# post request body
time cat <<< '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'| curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
--data @-
|
# post request body
time curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
--data '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'
| |
| ||
# put request body
time cat <<< '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'| curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
-X PUT \
--data @-
|
# put request body
time curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
-X PUT \
--data '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'
| |
| ||
# delete response body
time cat <<< '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'| curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
-X DELETE \
--data @-
|
# delete response body
time curl http://127.0.0.1:1983/v1/collections\
-H 'x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b'\
-H 'Content-Type:application/json'\
-X DELETE \
--data '{
"code": "M",
"name": "Male",
"group": "gender",
"properties": {},
"extendedProperties": {}
}'
| |
| ||
time curl http://127.0.0.1:1983/v1/collections time curl https://cdn.chorke.org/exec/cli/ curl --version curl --help |
References
| ||