Help with HTTP request to restful API


#1

1) Give a description of the problem
I’m attempting to get an HTTP POST request working to control an air conditioner with a fairly basic rest API. The request is not being sent to the API as expected, however the logs do not show the raw HTTP request so I am having trouble determining the issue. I have a simple test request set up using postman and am successful with control. Where can I find documentation on using the HTTP request feature of webcore?

2) What is the expected behaviour?
Send HTTP POST request with variable content to control air conditioner.

3) What is happening/not happening?
API not responding as expected.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)
Unable to post right now as not on the local network.

I think I could get it working if someone pointed me to the HTTP request feature documentation of webcore; I’m sure it’s something simple I’m missing.


#2

Not aware of any documentation but I would start with logging the $httpstatuscode. Do you get a response in postman? You might be able to log that response also, $response.


#3

I found the issue. I thought that clicking the execute piston external URL would execute the HTTP request, but I guess I misunderstood that link. To run the script the “test” button needs to be pressed.


#4

In my experience, clicking the
pic
will execute the piston, similar to pressing Test.

I run scripts by using that URL quite often.