You can include control and functional parameters in the HTTP message body of an Oracle Commerce Platform REST Web Services request. The following HTTP request includes two functional parameters and a control parameter in its message body. The content in the message body is specified by the -d flag in this cURL command.

curl -L -v -b customer_cookies.txt -H "Content-Type: application/json"
-d "{ "login" : "JohnDoe@example.com" , "password" : "password123" }"
"http://localhost:8280/rest/model/atg/userprofiling/ProfileActor/
login?atg-rest-user-input=MyMessageId"

The Oracle Commerce Platform REST Web Services server can interpret message body parameters in one of the following three markup formats. Make sure you set the correct Content-Type value for the markup that you use.

Setting the Content-Type Value in REST Services

Set the Content-Type value when you send an HTTP message with parameters in its message body. The Oracle Commerce Platform REST Web Services server uses this value to determine how to interpret the parameters. If you do not include the Content-Type or include a value that does not match the markup of your parameters, the server will ignore the message body.

Use one of the following Content-Type values to specify the markup of the parameters in a message body.

The following REST MVC example shows an HTTP request that sets its Content-Type to application/xml.

curl -L -v -b customer_cookies.txt -H "Content-Type: application/xml"
-d "{ "login" : "JohnDoe@example.com" , "password" : "password123" }"
"http://localhost:8280/rest/model/atg/userprofiling/ProfileActor/
login?atg-rest-user-input=MyMessageId"

Using Array Types

To specify an array type in the atg-rest-class-descriptor control parameter, use the standard Java notation for arrays.

Array Type

Java Notation

String

[Ljava.lang.String;

byte

[B

int

[I

Two-dimensional array of Strings

[[Ljava.lang.String;


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