# Pico W HTTP Server with CircuitPython

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/116/437/medium800thumb/projects_demoWithHTML.jpg?1667424215)

In this guide, you'll setup an HTTP (web) server with a Pico W running CircuitPython. HTTP servers are handy for creating custom web interfaces to monitor and control IoT projects.

This example sets a static IP address for the server, logs temperature readings from a DS18B20 temperature sensor, displays server information on an OLED and serves an HTML webpage with buttons that can send HTTP POST requests to toggle pins on the Pico W.

https://youtube.com/shorts/KLYujaG7E94

The HTML webpage is included in the **code.py** file as an [f-string](https://peps.python.org/pep-0498/) so that it can take in variables directly from **code.py**. The HTML code includes buttons that send POST requests for turning the Pico W onboard LED on and off and for displaying a party parrot animation on the OLED.

![projects_edited_P1390216.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/434/medium640/projects_edited_P1390216.jpg?1667423529)

The OLED displays important information about the server. It tells you the connection status, the name of your SSID, the IP address and the current temperature reading from the DS18B20. It can also show the less important, but more fun, party parrot animation.

![projects_oledToggle.gif](https://cdn-learn.adafruit.com/assets/assets/000/116/436/medium640thumb/projects_oledToggle.jpg?1667423740)

Since the Pico W is often affectionately referred to as the Pi-Cow, a bovine-themed 3D printed case is included for this project.

![projects_edited_P1390163.jpg](https://cdn-learn.adafruit.com/assets/assets/000/116/429/medium640/projects_edited_P1390163.jpg?1667405037)

## Prerequisite Guides
[Quick-Start the Pico W WiFi with CircuitPython](https://learn.adafruit.com/pico-w-wifi-with-circuitpython/overview)
[Using DS18B20 Temperature Sensor with CircuitPython](https://learn.adafruit.com/using-ds18b20-temperature-sensor-with-circuitpython)
[Monochrome OLED Breakouts](https://learn.adafruit.com/monochrome-oled-breakouts)
## Parts
### Raspberry Pi Pico W

[Raspberry Pi Pico W](https://www.adafruit.com/product/5526)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico W**. This...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5526)
[Related Guides to the Product](https://learn.adafruit.com/products/5526/guides)
![Angled shot of a green microcontroller with castellated pads.](https://cdn-shop.adafruit.com/640x480/5526-01.jpg)

### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
![Fully Reversible Pink/Purple USB A to micro B Cable](https://cdn-shop.adafruit.com/640x480/4111-02.jpg)

### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

In Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
![Monochrome 1.3" OLED module with Adafruit logos falling like snow](https://cdn-shop.adafruit.com/product-videos/640x480/938-05.jpg)

### Waterproof 1-Wire DS18B20 Digital temperature sensor

[Waterproof 1-Wire DS18B20 Digital temperature sensor](https://www.adafruit.com/product/381)
This is a pre-wired and waterproofed (with heat shrink) version of a 1 Wire DS18B20 sensor. Handy for when you need to measure something far away, or in wet conditions. While the sensor is good up to 125°C the cable is jacketed in PVC so we suggest keeping it under 100°C. Because they...

In Stock
[Buy Now](https://www.adafruit.com/product/381)
[Related Guides to the Product](https://learn.adafruit.com/products/381/guides)
![Angled Shot of the Waterproof 1-Wire DS18B20 Digital temperature sensor.](https://cdn-shop.adafruit.com/640x480/381-01.jpg)

### Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT

[Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT](https://www.adafruit.com/product/5200)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new Adafruit&nbsp;PiCowbell Proto is finally in stock and ready to assist your [Raspberry Pi Pico](https://www.adafruit.com/product/4864) and [Pico W](https://www.adafruit.com/product/5526)...

In Stock
[Buy Now](https://www.adafruit.com/product/5200)
[Related Guides to the Product](https://learn.adafruit.com/products/5200/guides)
![Angled shot of long, skinny prototyping breakout board.](https://cdn-shop.adafruit.com/640x480/5200-00.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Part: Socket Headers for Raspberry Pi Pico
quantity: 1
2 x 20 pin Female Headers
[Socket Headers for Raspberry Pi Pico](https://www.adafruit.com/product/5583)

### Part: 0.1" male header
quantity: 1
Break-away 0.1" 36-pin strip male header
[0.1" male header](https://www.adafruit.com/product/392)

### Part: JST-PH Battery Extension Cable
quantity: 1
500mm
[JST-PH Battery Extension Cable](https://www.adafruit.com/product/1131)

### Part: 220 ohm resistors
quantity: 1
Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25 Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25
[220 ohm resistors](https://www.adafruit.com/product/2780)

### Part: Machine Screw and Stand-off Set – M2.5 Thread
quantity: 1
Black Nylon Machine Screw and Stand-off Set – M2.5 Thread
[Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)

### Part: 5mm RGB Slow Blinking LED
quantity: 1
Auto changing RGB LED
[5mm RGB Slow Blinking LED](https://www.amazon.com/Multicolor-Flashing-Changing-Electronics-Components/dp/B01C19ENFA/)

### Part: M2 Brass Standoffs
quantity: 1
M2 standoffs
[M2 Brass Standoffs](https://www.amazon.com/300pcs-Standoff-Column-Spacer-Assortment/dp/B07B9X1KY6/)

- [Next Page](https://learn.adafruit.com/pico-w-http-server-with-circuitpython/circuit-diagram.md)

## Featured Products

### Raspberry Pi Pico W

[Raspberry Pi Pico W](https://www.adafruit.com/product/5526)
The Raspberry Pi foundation changed single-board computing [when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new **Raspberry Pi Pico W**. This...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5526)
[Related Guides to the Product](https://learn.adafruit.com/products/5526/guides)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

In Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
### Waterproof 1-Wire DS18B20 Digital temperature sensor

[Waterproof 1-Wire DS18B20 Digital temperature sensor](https://www.adafruit.com/product/381)
This is a pre-wired and waterproofed (with heat shrink) version of a 1 Wire DS18B20 sensor. Handy for when you need to measure something far away, or in wet conditions. While the sensor is good up to 125°C the cable is jacketed in PVC so we suggest keeping it under 100°C. Because they...

In Stock
[Buy Now](https://www.adafruit.com/product/381)
[Related Guides to the Product](https://learn.adafruit.com/products/381/guides)
### Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT

[Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT](https://www.adafruit.com/product/5200)
Ding dong! Hear that? It's the PiCowbell ringing, letting you know that the new Adafruit&nbsp;PiCowbell Proto is finally in stock and ready to assist your [Raspberry Pi Pico](https://www.adafruit.com/product/4864) and [Pico W](https://www.adafruit.com/product/5526)...

In Stock
[Buy Now](https://www.adafruit.com/product/5200)
[Related Guides to the Product](https://learn.adafruit.com/products/5200/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Socket Headers for Raspberry Pi Pico - 2 x 20 pin Female Headers

[Socket Headers for Raspberry Pi Pico - 2 x 20 pin Female Headers](https://www.adafruit.com/product/5583)
These&nbsp; **Socket Headers** &nbsp;alone are, well, lonely. But pair them with the&nbsp;[Raspberry Pi Pico](https://www.adafruit.com/category/875), and you're in business!

Socket headers are like the duct tape of electronics. They're great for connecting...

In Stock
[Buy Now](https://www.adafruit.com/product/5583)
[Related Guides to the Product](https://learn.adafruit.com/products/5583/guides)
### Break-away 0.1" 36-pin strip male header - Black - 10 pack

[Break-away 0.1" 36-pin strip male header - Black - 10 pack](https://www.adafruit.com/product/392)
Breakaway header is like the duct tape of electronics. It's great for connecting things together, soldering to perf-boards, fits into any breakout or breadboard, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of ten!<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/392)
[Related Guides to the Product](https://learn.adafruit.com/products/392/guides)

## Related Guides

- [Adafruit PiCowbell Proto for Pico](https://learn.adafruit.com/picowbell-proto.md)
- [NeoPixel Menorah](https://learn.adafruit.com/neopixel-menorah.md)
- [QT Py CH32V203 eInk / ePaper Daily Calendar and Clock](https://learn.adafruit.com/ch32v203-eink-epaper-calendar-and-clock.md)
- [Monitor Your Greenhouse with a No-Code Environmental Sensor](https://learn.adafruit.com/monitor-your-greenhouse-with-a-no-code-environmental-sensor.md)
- [PyPortal Pet Planter with Adafruit IO](https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io.md)
- [Raspberry Pi Pico and LED Arcade Button MIDI Controller](https://learn.adafruit.com/raspberry-pi-pico-led-arcade-button-midi-controller-fighter.md)
- [Kitty Toe Bean Keypad with Color TFT](https://learn.adafruit.com/kitty-toe-bean-paw-keypad-color-tct.md)
- [Huzzah Weather Display](https://learn.adafruit.com/huzzah-weather-display.md)
- [32x32 Square Pixel Art Animation Display](https://learn.adafruit.com/32x32-square-pixel-display.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
- [New Years Eve Ball Drop](https://learn.adafruit.com/new-years-eve-ball-drop.md)
- [EPCOT Spaceship Earth with WLED](https://learn.adafruit.com/epcot-spaceship-earth-with-wled.md)
- [Arcade Fightstick](https://learn.adafruit.com/arcade-fightstick.md)
- [ESP32-S3 BLE iOS Media Controller](https://learn.adafruit.com/esp32-s3-ble-ios-media-controller.md)
- [CircuitPython OctoPrint Controller and Monitor](https://learn.adafruit.com/circuitpython-octoprint-controller-and-monitor.md)
- [BrainCraft Camera Case](https://learn.adafruit.com/braincraft-camera-case.md)
