The Pixelsilk API function setContent updates the content of a section (page) by its path relative to the root. This content is the main content of the section (page).
path: the path to the section (page) relative to the root
value: the actual content to update the section (page) with

setContent returns the parameter "value" if it is not empty. Otherwise, it returns an empty string.

C# Example:
string content = SetContent(path, value);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/setContent HTTP/1.1
Content-Length: 159
Content-Type: application/x-www-form-urlencoded
Cookie: auth=CB1F098BAB73...A6AFDE47B58A

Request Data:
Unencoded Data:
   "value":"The test content has been modified."

Url-encoded Data:

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=6BD99C779077...4173BE92519; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 37

Response Data:
"The test content has been modified."

JavaScript Example:
Method Call:
pixelsilk2.setContent(input, callback)

Input Object:
    value:"This is the content of test modified."

Returned Data:
"This is the content of test modified."

Back to Content »