cURL to REST API
More curl goodness:
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/key \
-d '{"level":10}'
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/example/send \
-d '{"username":"me","password":"1234","level":10}'
using a file as input:
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/key \
-d @filename.json
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/key \
-d '{"level":10}'
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/example/send \
-d '{"username":"me","password":"1234","level":10}'
using a file as input:
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost//restserver/index.php/api/key \
-d @filename.json
use the -w(--write-out) flag to add a newline after stdout:
ReplyDelete-w '\n'