API Debugging
From ePrize Developers Wiki
For debugging and testing connectivity purposes, HelloWorld provides these resources that will demonstrate that known responses can be retrieved and data can be sent to HelloWorld web services.
Output communication test | GET | /v1/{apikey}/test/communication |
Output communication test (structured data) | GET | /v1/{apikey}/test/structured |
Input communication test | POST | /v1/{apikey}/test/communication |
Input URL communication test | PUT | /v1/{apikey}/test/communication/{value} |
Error response test | PUT | /v1/{apikey}/test/communication |
Testing the webservices prior to deployment, or during development is best done with a tool that will display the full HTTP communication interaction with the server, including all headers for the request and response. While certain resources can be viewed with a normal browser, it is not a recommended way to test or learn about the APIs since there is not enough information displayed.
HelloWorld developers often use cURL (http://en.wikipedia.org/wiki/CURL), or Wireshark (http://en.wikipedia.org/wiki/Wireshark) to examine the communication between the client and server. Some specific curl commands are listed here:
Basic communication testing:
%curl -i -T /dev/null http://localhost:8080/v1/solution/ews/test/communication/TEST%2F%E2%99%A1ING %curl -i -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication %curl -i http://localhost:8080/v1/solution/ews/test/communication
Passing form parameters with curl, also request certain content types:
%curl -i -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication.xml %curl -i -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication.json %curl -i -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication.yaml %curl -i -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication.txt
Passing Accept: Headers with curl:
%curl -i -H "Accept: application/json" -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication