API Debugging
From ePrize Developers Wiki
(6 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
+ | {{Logo}} | ||
[[API Home Page]] | [[API Home Page]] | ||
+ | |||
+ | 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. | ||
<div class="api_table"> | <div class="api_table"> | ||
Line 5: | Line 8: | ||
|- | |- | ||
| [[Output communication test]] | | [[Output communication test]] | ||
- | | GET /v1/{apikey}/test/communication | + | | GET |
- | | | + | | /v1/{apikey}/test/communication |
+ | |- | ||
+ | | [[Output communication test (structured data)]] | ||
+ | | GET | ||
+ | | /v1/{apikey}/test/structured | ||
|- | |- | ||
| [[Input communication test]] | | [[Input communication test]] | ||
- | | POST /v1/{apikey}/test/communication | + | | POST |
- | + | | /v1/{apikey}/test/communication | |
|- | |- | ||
| [[Input URL communication test]] | | [[Input URL communication test]] | ||
- | | PUT /v1/{apikey}/test/communication/{value} | + | | PUT |
- | + | | /v1/{apikey}/test/communication/{value} | |
|- | |- | ||
| [[Error response test]] | | [[Error response test]] | ||
- | | PUT /v1/{apikey}/test/communication | + | | PUT |
- | + | | /v1/{apikey}/test/communication | |
|- | |- | ||
|} | |} | ||
</div> | </div> | ||
- | + | 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 | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | curl -i -H "Accept: application/json" -d value=TEST%2F%E2%99%A1ING http://localhost:8080/v1/solution/ews/test/communication | + | |
- | + |
Current revision
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