...
The following example is a request to the testGet API, without providing the required authentication credentials.
Code Block |
---|
# go to controller directory cd /opt/soajs/node_modules/soajs.controller # export necessary environment variables export SOAJS_PROFILE=/opt/soajs/node_modules/soajs.utilities/data/getStarted/profile.js export SOAJS_ENV=test export SOAJS_SRVIP=127.0.0.1 # start service node . # hit the API curl -X GET "http://127.0.0.1:40114000/example02/buildName?firstName=John&lastName=Smith" |
...
Code Block |
---|
curl -X POST -H "Authorization: Basic MTBkMmNiNWZjMDRjZTUxZTA2MDAwMDAxOnNoaGggdGhpcyBpcyBhIHNlY3JldA==" -H "key:aa39b5490c4a4ed0e56d7ec1232a428f771e8bb83cfcee16de14f735d0f5da587d5968ec4f785e38570902fd24e0b522b46cb171872d1ea038e88328e7d973ff47d9392f72b2d49566209eb88eb60aed8534a965cf30072c39565bd8d72f68ac" "http://127.0.0.1:40024000/oauth/token" -d 'username=oauthuser&password=oauthpassword&grant_type=password' |
...
Code Block |
---|
curl -X GET "http://127.0.0.1:40114000/example02/buildName?firstName=John&lastName=Smith&access_token=30f3a13fcdb60cde1cdf576634cbb7777df31177" |
...