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?