Add an example Apache virtual host configuration and curl script for testing the...
[OpenSRF.git] / examples / math_client_curl.sh
1 #!/bin/sh
2
3 # Simple demonstration of invoking a public OpenSRF method via curl
4
5 # Expected output will be something like:
6 # [{"__c":"osrfMessage","__p":{"threadTrace":"0","locale":"en-CA","type":"RESULT","payload":{"__c":"osrfResult","__p":{"status":"OK","statusCode":"200","content":4}}}},{"__c":"osrfMessage","__p":{"threadTrace":"0","locale":"en-CA","type":"STATUS","payload":{"__c":"osrfConnectStatus","__p":{"status":"Request Complete","statusCode":"205"}}}}]
7
8 curl -H "X-OpenSRF-service: opensrf.math" --data 'osrf-msg=[{"__c":"osrfMessage","__p":{"threadTrace":0,"type":"REQUEST","payload":{"__c":"osrfMethod","__p":{"method":"add","params":[2,2]}},"locale":"en-CA"}}]' http://localhost/osrf-http-translator