Reputation: 35
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:
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?
Upvotes: 0
Views: 104