I’m running code on ESP32 (with the A7670 modem) that uses the TinyGSM library.
Part of that code attempts to POST to a URL:
TinyGsm modem(SerialAT);
// ...
// Code to initialize the modem
// ...
String server_url = "https://xxxxxxxxxx.execute-api.eu-west-1.amazonaws.com/dev/path/element";
modem.https_begin();
if (!modem.https_set_url(server_url)) {
Serial.println("Failed to set the URL");
return;
}
String post_body = "";
int httpCode = modem.https_post(post_body);
if (httpCode != 200) {
Serial.print("HTTP post failed ! error code = ");
Serial.println(httpCode);
return;
}
The attempt fails with an error code 715.
Two observations:
- When running the code but using WiFi instead of the GSM modem, all works well
- When running the code still using the GSM modem but with a shorter URL i.e httpbin.org, all works well
This leads me to wonder whether the issue is about the length of the URL and the Modem.
I used a URL shortener to turn the original URL into a 20 characters URL, and the code (using the GSM) seems to work (i.e. it returns an HTTP 307 instead of 715. But, of course, I can’t follow the redirection since it brings me back to the initial problem)
Could anybody shed some light on this?