-
-
Save pydawan/29908b1d316c5d01018ccfd21a230cda to your computer and use it in GitHub Desktop.
Revisions
-
Kartones revised this gist
Sep 3, 2019 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,10 @@ curl -i -H 'Accept: application/json' -X POST -F "filename=@/file/path" -F "othe ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"key1":"value1"}' "http://hostname/resource" ``` * POST ```bash curl -i -X POST -H 'Content-Type: application/x-www-form-urlencoded' --data 'key1=value1&key2=value2' url ``` * "Debugging mode" (without actual content output): ```bash curl -XGET -vvv http://hostname/resource > dev\null -
kartones-tkt revised this gist
Sep 18, 2017 . 1 changed file with 9 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,27 @@ * XML GET ```bash curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource" ``` * JSON GET ```bash curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource" ``` * JSON PUT ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"updated_field1":"updated_value1"}' "http://hostname/resourcex" ``` * JSON POST uploading a file ```bash curl -i -H 'Accept: application/json' -X POST -F "filename=@/file/path" -F "other_field=its_value" "http://hostname/resource" ``` * JSON DELETE ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"key1":"value1"}' "http://hostname/resource" ``` * "Debugging mode" (without actual content output): ```bash curl -XGET -vvv http://hostname/resource > dev\null ``` ### Useful arguments * ```-k```: not check SSL certificates -
Kartones revised this gist
Feb 11, 2016 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,8 @@ curl -i -H 'Accept: application/json' -X POST -F "filename=@/file/path" -F "othe curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"key1":"value1"}' "http://hostname/resource" ``` ### Useful arguments * ```-k```: not check SSL certificates * ```-L```: follow redirects * ```-v```: get verbose output * ```-V```: get headers at output -
Kartones revised this gist
Jan 23, 2016 . 1 changed file with 17 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,23 @@ * XML GET ``` curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource" ``` * JSON GET ``` curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource" ``` * JSON PUT ``` curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"updated_field1":"updated_value1"}' "http://hostname/resourcex" ``` * JSON POST uploading a file ``` curl -i -H 'Accept: application/json' -X POST -F "filename=@/file/path" -F "other_field=its_value" "http://hostname/resource" ``` * JSON DELETE ``` curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"key1":"value1"}' "http://hostname/resource" ``` * use ```-k``` to not check SSL certificates * use ```-L``` to follow redirects -
Kartones revised this gist
Oct 26, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,17 @@ curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"table_name":"ojete"}' "http://d.localhost.lan:3000/api/v1/tables/641732/registar/?api_key=xxxx" ``` ```bash curl -i -H 'Accept: application/json' -X POST -F "filename=@/file/path" -F "other_field=its_value" "http://d.localhost.lan:3000/api/v1/tables/642009/registar/?api_key=xxx" ``` ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"table_name":"untitled_table_2"}' "http://d.localhost.lan:3000/api/v1/tables/642009/registar/?api_key=xxx" ``` * use ```-k``` to not check SSL certificates * use ```-L``` to follow redirects * use ```-v``` to get verbose output -
Kartones revised this gist
Dec 16, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,5 @@ curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DEL ``` * use ```-k``` to not check SSL certificates * use ```-L``` to follow redirects * use ```-v``` to get verbose output -
Kartones revised this gist
Dec 16, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,5 +7,5 @@ curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"table_name":"untitled_table_2"}' "http://d.localhost.lan:3000/api/v1/tables/642009/registar/?api_key=xxx" ``` * use ```-k``` to not check SSL certificates * use ```-L``` to follow redirects -
Kartones revised this gist
Dec 16, 2014 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,5 @@ curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"table_name":"untitled_table_2"}' "http://d.localhost.lan:3000/api/v1/tables/642009/registar/?api_key=xxx" ``` use ```-k``` to not check SSL certificates use ```-L``` to follow redirects -
Kartones created this gist
Jul 23, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"table_name":"ojete"}' "http://d.localhost.lan:3000/api/v1/tables/641732/registar/?api_key=xxxx" ``` ```bash curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE -d '{"table_name":"untitled_table_2"}' "http://d.localhost.lan:3000/api/v1/tables/642009/registar/?api_key=xxx" ``` use ```-k``` to not check SSL certificates