Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - s0meguy

Pages: 1
1
HI, I am trying to create a HTTPS POST request to make an API call to the Sensibo API.

I can't seem to get any response from the server.
I tried changing the code to client.connectSSL(server, 443), but did not get any response.

I tried to use the default and the modified Firmware Updater tool from http://forum.tinycircuits.com/index.php?topic=1969.msg4061#msg4061, to update the SSL root certificates for connectSSL() but both tools did not work.
Both Firmware Updater showed the "Programmer not responding" error.

Help is much appreciated.

connect() function:
Code: [Select]
char server[] = "home.sensibo.com";

SerialUSB.println("\nStarting connection to server...");
  // if you get a connection, report back via SerialUSB:
  if (client.connect(server, 80)) {
    SerialUSB.println("connected to server");
    // Make a HTTP request:
    client.println("POST /api/v2/pods HTTP/1.1");
    client.println("Host: home.sensibo.com");
    client.println("Connection: close");
    client.println();
  }

The connect() function returns this response this:
Code: [Select]
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Date: Fri, 12 Nov 2021 16:49:22 GMT
Location: https://home.sensibo.com/api/v2/pods
Server: nginx
Strict-Transport-Security: max-age=63072000
Content-Length: 162
Connection: Close

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Pages: 1
SMF spam blocked by CleanTalk