fixing http_request_example request content

request new lines must be `\r\n` as specified in the HTTP RFC.
Also the following logic checks for the socket to be closed by the server. This only happens with HTTP/1.0 not HTTP/1.1. So I have adjusted the protocol in the request, too.
This commit is contained in:
Malte Janduda 2017-04-07 11:56:13 +02:00 committed by Ivan Grokhotkov
parent 375b28650b
commit 1dc3ae6e4e

View File

@ -46,10 +46,10 @@ const int CONNECTED_BIT = BIT0;
static const char *TAG = "example";
static const char *REQUEST = "GET " WEB_URL " HTTP/1.1\n"
"Host: "WEB_SERVER"\n"
"User-Agent: esp-idf/1.0 esp32\n"
"\n";
static const char *REQUEST = "GET " WEB_URL " HTTP/1.0\r\n"
"Host: "WEB_SERVER"\r\n"
"User-Agent: esp-idf/1.0 esp32\r\n"
"\r\n";
static esp_err_t event_handler(void *ctx, system_event_t *event)
{