Actix-web is simply returning "br, gzip, deflate, zstd". No error, no traces #2535
-
I have written a server program using The same code does not work on an esp8266 IOT module, it simply return this string as the response with the status code as 406
I figured that the actix-web HttpServer::new(|| {
App::new()
.wrap(middleware::Compress::default())
.service(index)
})
.bind("127.0.0.1:8080")?
.run()
.await I tried adding traces to the actix-web program but there isn't much error/info available there as well. This is all that I see:
What can be done here to fix this issue? Arduino code snippet: HTTPClient https;
String fullUrl = "https://127.0.0.1:8000";
Serial.println("Requesting " + fullUrl);
if (https.begin(client, fullUrl)) {
https.addHeader("Accept-Encoding", "gzip, deflate, br");
https.addHeader("Content-Type", "application/json");
https.addHeader("Accept", "*/*");
int httpCode = https.GET();
Serial.println("Response code: " + String(httpCode));
if (httpCode > 0) {
Serial.println(https.getString());
}
https.end();
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This probably isn't the issue, but In relation to this question: What features have you enabled for actix-web? |
Beta Was this translation helpful? Give feedback.
This probably isn't the issue, but
Content-Type
describes the format of the request body, and since you're sending aGET
request there is no request body, therefore theContent-Type
header is not proper.In relation to this question: What features have you enabled for actix-web?