// project
Pico HTTP
A clean, minimal HTTP client example for the Raspberry Pi Pico 2 W.
Overview
Pico HTTP is a deliberately small HTTP client example for the Raspberry Pi Pico 2 W. It connects to Wi-Fi, requests a single file over HTTP, and copies the response into a buffer and nothing more. It’s not meant to be a library or a finished product, just clean reference code that’s easy to read, copy, and adapt.
It exists because most of the existing httpc_get_file_dns examples out there have real problems: some only process the first network packet because they’re missing the altcp_recved() call, some leak memory by never freeing the packet buffer, and most just print the response as it arrives instead of actually storing it anywhere. This one fixes all three.
To use it: clone the repo, drop a Wi-Fi network name and password into example.c, then the usual Pico SDK build — mkdir build, cd build, cmake .., make. That produces an example.uf2 file ready to copy onto the board.
- Wi-Fi + HTTP — Connects to Wi-Fi, then fetches a single file over HTTP into a buffer.
- No memory leaks — Frees the packet buffer properly, unlike a lot of the examples floating around.
- Handles multi-packet responses — Calls altcp_recved() so it doesn't silently drop everything after the first packet.
- Copy-paste ready — Small enough to lift straight into another project.