netzulo/testlink-tests

View on GitHub
rest-api/v1/curl/testplan/createTestPlan.sh

Summary

Maintainability
Test Coverage
#!/usr/bin/sh
# curl -i -X POST -u dev01:dev01 http://localhost/development/tlrepo/lib/api/rest/v1/testprojects
# -i include headers
# -X (HTTP) Specifies a custom request method to use when communicating with the HTTP server  
# -u user:password
# --data If you start the data with the letter @, the rest should be a file name to read the data from, 
#        or - if you want curl to read the data from stdin. 
#        The contents of the file must already be URL-encoded. 
#        Multiple files can also be specified. 
#        Posting data from a file named 'foobar' would thus be done with --data @foobar.
#
echo 'Testing TestLink REST API - POST /testplans'
curl -i -H "Content-Type: application/json" -X POST --data "@../json/createTestPlan.json" \
     -u restadminapikey:thebrownfox http://localhost/development/tlrepo/lib/api/rest/v1/testplans