Everytime I want to connect Glide table API, I got error code (-1)

I am trying to update the data measured by ESP32-CAM using Glide table API. However, every time I use the POST method, I get the message ‘connection refused’ with the httpReponseCode displayed as -1.

The code I used for ESP32-CAM is shown below. The ROW ID of the Glide table is always the same, so I used a fixed value.

here is api url
const char* apiUrl = “https://api.glideapp.io/api/function/mutateTables”;

and other code is in below

What response do you get if you use the curl example (in a terminal) with the same values?

Thank you. When I use curl in “https://reqbin.com/curl” here. I got this result below.

And I can see the value I request using curl in Glide table.

Okay.

A -1 response I believe suggests some sort of connection problem. Are both tests going through the same network gateway? Could there be a firewall or similar getting in the way?

I think so. I use same WiFi SSID to test this one but can not sure about gateway, firewall.
Sorry I have lack of knowledge about sorts of things.

When you do that, the request is being sent from reqbin.com, not from your local machine.

What sort of machine are you using? Windows, Mac?
You need to open a terminal console on your local machine and send the curl request from there, and see if you get the same response.

1 Like

Wow now I can use cURL on my terminal in Mac.
When I input same commend that I use reqbin.com/curl, I got this result (below image). And the table is updated with my value ‘10’. It works.

Okay, so that seems to rule out a network issue.
So there must be something not right with the request that your program sends.

Is there any way that you can log the HTTP Request and Response payloads so that you can see more detail?

If you are familiar with tcpdump, you could run that in a terminal and capture the raw packets.

Sorry. I am not familiar with tcpdump.
Now I solve this problem with webhoo on make.com again.

2 Likes