When writing an example, use cURL to perform the following:

REST MVC cURL Format

When invoking cURL for REST MVC examples, use the following format:

curl <command component> <cookie file> -H <content type> -d "{ <parameter> :
<value>, <parameter> : <value> }" "http://<servername>:<port>/rest/model/
<REST actor-chain component>/<chain ID>?<control parameter>"

The following is a cURL example of a REST MVC external user log in. This example uses the cookie file customer_cookies.txt, identifies the content type as JSON, and provides the parameters and their values that are used by the ProfileActor login actor-chain.

curl -L -v -c customer_cookies.txt -H "Content-Type: application/json"
-d "{ "login" : "JohnDoe@example.com" , "password" : "password123" }"
"http://localhost:8080/rest/model/atg/userprofiling/ProfileActor/
login"
Legacy REST cURL Format

When invoking cURL for Legacy REST examples, use the following format:

curl <command component> <cookie file> -X <HTTP communication type>
-H <content type> -d "<parameter><arg><value></arg></parameter>"
"http://<servername>:<port>/rest/bean/<REST service>?<control parameter>"

The following is a cURL example of a Legacy REST external user log in. This example uses the cookie file cookies.txt, identifies the HTTP communication method of POST and provides the MyUsername and MyPassword arguments.

curl -v -c cookies.txt -X POST -H "Content-Type: application/xml" \
-d "<parameters><arg1>MyUsername</arg1><arg2>MyPassword</arg2></parameters>" \
"http://myserver:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser"

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices