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.
pull/468/merge
Malte Janduda 2017-04-07 11:56:13 +02:00 zatwierdzone przez Ivan Grokhotkov
rodzic 375b28650b
commit 1dc3ae6e4e
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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)
{