SetBody method: PTDirectTransferObject class

Syntax

SetBody(Body)

Description

Use the SetBody method to set the JSON body as string for POST or PUT requests. You can use the CreateJsonBuilder function to form seamless JSON structures.

Note:

For PeopleSoft application use, the attributes in the search engine are standardized with a specific suffix to support various analyzers. For example, the DESCR attribute in a search definition is created as DESCR_ORCL_ES_ENG in the search index. Related language fields should use the appropriate language code as a suffix. For example, DESCR_ORCL_ES_FRA for DESCR field in French. DirectTransfer expects the attribute name to be provided as it exists in the search engine. If not, a new field of default mapping is created in the search engine.

Parameters

Parameter Description

Body

Specifies the body of a request as a String.

Returns

An Integer value indicating the libcurl error code.

Example

Local PTDirectTransferObject &PTDTObject = CreateDirecttransferObject();
Local JsonBuilder &jb = CreateJsonBuilder();
&jb.StartObject("");
&jb.AddProperty("FIRST_NAME", "MyFirstName");
&jb.AddProperty("LAST_NAME", "MyLastName");
&jb.EndObject("");
Local string &sBody = &jb.ToString();
Local integer &return = &PTDTObject.SetBody(&sBody);