Appending Headers to WebSocket Connection?
Posted: Wed Dec 11, 2019 4:53 pm
I need to append some keys to the http header when connecting via websockets.
From the websocket example, I tried:
But esp_http_client_set_header hasn't been declared. Is there a esp_websocket_set_header equivalent?
How do I append keys to the header when connecting with websockets?
From the websocket example, I tried:
Code: Select all
esp_websocket_client_handle_t client = esp_websocket_client_init(&websocket_cfg);
esp_http_client_set_header(client, "x-device-id", device_id);
esp_http_client_set_header(client, "x-device-type", "generic");
esp_http_client_set_header(client, "x-device-token", token);
esp_websocket_register_events(client, WEBSOCKET_EVENT_ANY, websocket_event_handler, (void *)client);
How do I append keys to the header when connecting with websockets?