Open akjt opened 1 month ago
Hi, would it be possible to show the source code? Its hard to say something without knowing what is expected.
std::future<void >ff;
crow::App<crow::CORSHandler> m_app;
CROW_ROUTE(m_app, "/traff").methods(crow::HTTPMethod::PUT)(
[](const crow::request& request, crow::response& response) {
std::cout << request.body << std::endl;
response.body = "Thanks!";
response.end();
});
ff = m_app.bindaddr("127.0.0.1")
.port(5600).stream_threshold(6097152)
.signal_clear().loglevel(crow::LogLevel::DEBUG)
.run_async();
The error would be thrown from the http parser if you send an invalid request method - or alternatively if something is wrong with the encoding of the request. As the request method is on the beginning of the request I would assume there is maybe something wrong with encoding of requests - maybe an overwrite on the client side? Look first of what is sent - maybe with wireshark to get sure that you see what is going over the wire.
By reducing the size of what I send below 1KB it seems to work though
I can't see, what is sent over the wire. so for now I assume, an incorrect Method is sent if request size is above 1K. The request is encoded on a client not on server side.
Is there a limit to the size of the request message.
When I run a
curl -x PUT url -H "Content-Type: application/json" -d "JsonMessage"
it seems that when the json message exceeds 1000 bytes I dont get any response back from my end point. In fact, it seems that problem happens somewhere deep inside the crow code, i.e., I dont reach to my callback url.
Curl just replies back with the following: curl: (52) Empty reply from server
Any help / hint would be much appreciated
@The-EDev
I discovered stream_threshold which is defaulted to around 1MiB, however , this seems to only apply for response body, not request bodies. Is there really no way I can extend the threshold to send larger request bodies
I now tried with debug log enabled and I got some more logs: - please note when reducing the json size I dont see the invalid http method error