1) Give a description of the problem
I’m using Make a web request to send a POST to a webservice (nzbget’s JSON-RPC service if you’re wondering). An example request is:
{method: "rate", params: [123]}
That’s essentially a json object with two keys, one has a string value and the other is an array of strings (just one value at position 0).
Plan is to pass this as the content body/send variables
2) What is the expected behavior?
I need a good way to define this in webCoRE, have tried:
- Trying to create a string which happens to be formatted as a JSON object - had a hard time escaping the doublequotes.
- Creating an array/list with keys as position names and values - but I can’t then pass that array
- Just passing arguments and triggering from another piston - also failed, was an early attempt.
3) What is happening/not happening?
See above
**4) Post a Green Snapshot of the piston!
This is in an early stage, manually triggered for now.
Eventually I’d like to be able to call that from other pistons with a simple argument that gets passed as the rate (e.g. Everyone leaves, set rate to 3500)
5) Attach any logs (From ST IDE and by turning logging level to Full)
+1ms ╔Received event [Home].time = 1508364426618 with a delay of -1332ms +204ms ║RunTime Analysis CS > 30ms > PS > 102ms > PE > 71ms > CE +216ms ║Runtime (38878 bytes) successfully initialized in 102ms (v0.2.0fa.20171011) (215ms) +217ms ║╔Execution stage started +243ms ║║Sent to NZBget: [method:rate, params:1234] +244ms ║║Executed virtual command log (1ms) +253ms ║║Code: 408 +254ms ║║Executed virtual command log (1ms) +256ms ║╚Execution stage complete. (39ms) +265ms ╚Event processed successfully (265ms)
Note about the event at 243ms: That wasn’t actually sent to nzbget (look closely at the code, at the time of screenshotting, nothing was being sent)
Have been both googling and searching, including getting the idea about arrays from the recent thread in Meta about it, something kind of on the smartthings forums (can’t link, new users can only post 2 links) and this on the same subject but not using JSON objects.