Hello All, I’m also working on a RESTlet and havi...
# suitescript
s
Hello All, I’m also working on a RESTlet and having trouble with a seemingly simple RESTlet. It’s basically just a hello world program, but I want to get some sample http calls working in Postman. I’m using OAuth TBA for authentication if that matters. Here is my sample code:
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType restlet
*/
define([], function() {
 return {
  get: function() {
   return "Hello get!"
  },
  post: function() {
    return "Hello post!";
  }
 }
});
When I perform a GET on the endpoint, postman returns
"Hello get!"
However I change the http request to POST and hit send and I get this:
Copy code
{
  "error": {
    "code": "SYNTAX_ERROR",
    "message": "org.mozilla.javascript.EcmaError: SyntaxError: Unsupported number format: ------ (INVOCATION_WRAPPER$sys#26)."
  }
}
Has anyone encountered this when developing a RESTlet? Do I need to set extra headers on the POST? Thanks.