String Differences for RESTlet Post Method
In SuiteScript 2.0, a JSON.stringify() call is added internally to whatever is passed in the post() method of a RESTlet, which affects the value passed. In SuiteScript 2.1, a JSON.stringify() call is not added to the post() method for a RESTlet.
|
Scenario |
SuiteScript 2.0 Behavior |
SuiteScript 2.1 Behavior |
|---|---|---|
|
Return JSON.stringify in a post function:
|
Returns "\"flower\"" and a string length of 12. If you specify "flower" in the return statement, "flower" is returned with a string length of 8. |
Returns "flower" and a string length of 8. If you specify "flower" in the return statement, flower is returned with a string length of 6. |
|
The log statements are: xmlRequest.responseText="\"ok\"" xmlRequest.responseText.length=8 |
The log statements are: xmlRequest.responseText="ok" xmlRequest.responseText.length=4 |