NodeJS Post Data

17 views
Skip to first unread message

TonioVids

unread,
Apr 24, 2017, 9:29:06 PM4/24/17
to Dandelion Support Forum
Hi!

I'm trying to work with the custom spot definition API, but I have an issue that I don't understand.

I tried to push my data to the API in the URI, but I have a problem of length of the URI.

So I decided to post my data, with this line:

request.post(dandelionApiBaseURL+"custom-spots/v1?token="+token, mySpots,  function (error, response, body) { /* My return actions */})

But when I type that, I have this error: "{"message":"Parameter [data] not found","code":"error.missingParameter","data":{"parameter":"data"},"error":true}"
I tried to replace mySpots by { data: mySpots], but it didn't change anything.

I'm quiet confused about how to solve this problem. Does anyone have an idea?

Thank you very much!

Tonio

Roberto

unread,
Apr 27, 2017, 11:20:23 AM4/27/17
to Dandelion Support Forum
Hi Tonio,

from your example and the error message that you get, it seems that you are passing the data parameters via the query string and not in the body of the request. Try to pass the parameter in the body instead: this should solve your problem.

Cheers,

Roberto Santoro
Dandelion API team
Reply all
Reply to author
Forward
0 new messages