Failing to send json message

Im trying to sync my imp with pushover service.
they have a detailed API how to use. I followed their guide and created token for an app i created, i have my user id also and i try to send a message.
the api can be followed here:
I tried various outputs, all fails with 400 bad request, i guess its because i dont succeed to create the data correctly.
i tried:
a = { token="TOKEN_ID" user="USER_ID" message="hellooo" } strout.set(a);
and my http request is set to the correct url, with POST, i tried both url-encoded and json encoded. didnt help.
i tried also to set strout to \"token\":\"TOKEN_ID\",\"user\":\"USER_ID\",\"message\":\"Hi\""
or token=.....&user=....&message=.....
it seems that nothing helps. I tried to connect a “show input” which shows { errors: 'JSON/XML parameter input ... but i cant see the rest of the message to debug it correctly.
in url-encoded i have a different message: { token: 'invalid', errors: ['applicatio... but again, i dont know the rest of it.
could someone suggest something i can do?

Just a guess, but they have disabled JSON and XML input parsing according to this note.

so it is not working for me because i send an already parsed json request?
do i need to send a not-parsed request for it to work? (is it possible?)

You need to send data as parameters, and URL encoded, as in their spec:

`POST /1/messages.json
Content-Type: application/x-www-form-urlencoded
Content-Length: 180


I failed to mention but It’s the first syntax I tried
I tried to send to my output port just the string X =“token=… &…” it failed as the others

no one knows how i create such POST method with this particular data?

If you post your complete code I can take a look at it. is great for posting code.

I tried many combinations, it all comes to this sort of code:
`local lcdstr = OutputPort(“lcd string”);

class httpin extends InputPort
name = "HTTP IN Text"
type = “number”

function set(value)
if (“n” in value) {
operateSwitch(); //Turns off/on switch, buttons whatever…
imp.configure(“Serial RX”, [httpin], [lcdstr]);

thats a small version of my code, initVariables, operateSwitch are irrelevant for this case.
I guess that the string I send to the output port is being encoded into something else, so if I want my msg to contain the data as I send it (feild=…&field2=…) How do i send it to my output port?
in the http request node in my planner I set it to POST to url and i tried both JSON or urlencoded.

One thing shouldn’t your output port be declared as
local lcdstr = OutputPort(“lcd”, “string”);

Also can you see what’s being emitted by HTTPout?
I use for this sort of thing seems as a good idea, thank you.
I tried using wireshark to see traffic of the imp, but couldnt see any.
I will try this one, it will help me a lot.

I see the issue clearly…
It changes it to this:
it adds value=, at start, and changes ‘&’ to %3D, and adds garbage at the end.
Thats with urlencoded, when i try json, it sends

is there any way to get rid of this stuff?

No, I’ve only used GET which does the same.
When Agents come you will be able for sure to do this.
But for now you will have to use a proxy/intermediate server forward to Pushover which is a great service.

Maybe its a little OT, but do you know of any free solution?
when agents will come, i will be able to read the status of my imp, so i wont need to push a notification

No free service I know off other might.

when agents will come, i will be able to read the status of my imp
Yep is my understanding but for me I still want and need push notifications.

Well, i didnt find any other alternatives other than pushover.
unless it will be possible to create the data itself with agent, so i dont see how it will work