Difference between revisions of "RESTful and SOAP calls"
Jump to navigation
Jump to search
Line 32: | Line 32: | ||
*[http://http-prompt.com/ http-prompt.com] | *[http://http-prompt.com/ http-prompt.com] | ||
*[https://www.tecmint.com/http-prompt-command-line-http-client/ http-prompt-command-line-http-client] | *[https://www.tecmint.com/http-prompt-command-line-http-client/ http-prompt-command-line-http-client] | ||
*[https://github.com/jakubroztocil/httpie HTTPie: a CLI, cURL-like tool for humans] | |||
= References = | = References = |
Revision as of 14:38, 27 May 2019
Use curl to test RESTful API
curl --insecure -X GET \ --header "Accept: application/json" \ --header "Authorization: Bearer geasrExampleTokengwsdvb" \ "https://host1.aws.example.com/ApiBaseLocation/v1/ApiName/Value"
Options explained
--insecure
disables ssl checks like the certificate chain check, etc.-X, --request <command>
it defaults to GET commands, check HTTP1.1 specification for more-H, --header <header>
(HTTP) Extra header to include in the request when sending HTTP to a server
Use Chrome addon Postman
Run Chrome in ssl disable verification mode in case you hit CN url mismatch in SSL certificate
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --ignore-certificate-errors
HTTP Prompt – An Interactive Command Line HTTP Client
Install
pip install http-prompt #requires root and sudo is not advised pip install --user http-prompt
Use
http-prompt http://localhost:3000 http-prompt localhost:3000/api --auth user:pass username=somebody
Resources
References
- How to test a REST api from command line with curl codingpedia.org
- Chrome Postan Addon advanced UI addon to test Restful API. You may need to disable SSL verification in chrome://flags/#allow-insecure-localhost
- List of Chromium Command Line Switches Chrome command line options