esp-idf/examples/protocols/http2_request
David Cermak 5b75693522 esp_netif/lwip: Fix core-locking config (v5.0)
* Fix thread safety issues in non-core locking
* Add option to verify thread safety issues in lwip (core-lock assertion)
* Make esp_sntp.h thread safe API
* Fix sntp examples

Closes https://github.com/espressif/esp-idf/issues/9908
Closes https://github.com/espressif/esp-idf/issues/10502
Closes https://github.com/espressif/esp-idf/issues/10466
2023-03-21 11:09:56 +01:00
..
main esp_netif/lwip: Fix core-locking config (v5.0) 2023-03-21 11:09:56 +01:00
CMakeLists.txt tools: Increase the minimal supported CMake version to 3.16 2022-06-01 06:35:02 +00:00
pytest_http2_request.py http examples pytest migration 2022-06-03 16:00:52 +05:30
README.md docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
sdkconfig.ci kconfig: move remaining kconfig options out of target component 2022-05-23 17:57:45 +08:00
sdkconfig.defaults http2_request_example: Use esp_crt_bundle instead of hardcoded root 2022-04-13 10:34:34 +05:30

Supported Targets ESP32 ESP32-C3 ESP32-S2 ESP32-S3

HTTP/2 Request Example

Establish an HTTP/2 connection with https://http2.github.io

  • Performs a GET on /index.html

How to use example

Before project configuration and build, be sure to set the correct chip target using idf.py set-target <chip_name>.

Hardware Required

  • A development board with ESP32/ESP32-S2/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
  • A USB cable for power supply and programming

Configure the project

idf.py menuconfig

Open the project configuration menu (idf.py menuconfig) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in examples/protocols/README.md for more details.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

idf.py -p PORT flash monitor

(Replace PORT with the name of the serial port to use.)

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Example Output

I (5609) example_connect: - IPv4 address: 192.168.0.103
I (5609) example_connect: - IPv6 address: fe80:0000:0000:0000:ae67:b2ff:fe45:0194, type: ESP_IP6_ADDR_IS_LINK_LOCAL
Connecting to server
Connection done
[get-response] <!DOCTYPE HTML>
<html lang="en">
.
.
.
Body of index.html
.
.
.
.
</html>
[get-response] Frame fully received
[get-response] Stream Closed