Skip to main content

A HTTP server to use for testing

Project description

Test HTTP Server

This is a simple HTTP server that will respond to a single HTTP request and record some of the data. It is still an early version and doesn’t do everything you probably want.

Installing

pip install testhttpserver

Using in your tests

To create a test server import the server

from testhttpserver import Server

And then create a new instance including the port, response status and content.

server = Server(8000, response_status=200, response_content=’Content’)

After you make your request to http://localhost:8000/ . If you POST to the server it will have post_headers and post_content available.

When you are done remember to join()!

server.join()

See tests/test_server.py for an example!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testhttpserver-0.1.2.tar.gz (7.9 kB view details)

Uploaded Source

File details

Details for the file testhttpserver-0.1.2.tar.gz.

File metadata

File hashes

Hashes for testhttpserver-0.1.2.tar.gz
Algorithm Hash digest
SHA256 514a1e81116fc37e24ab70b253b36f294d49122b9be1965e5197bc6f1306d2e4
MD5 326592ea6b4c98be4185a9c184565bdb
BLAKE2b-256 7b84c8b0eccdc4b35c734354899fe4394ee3b7db881e1517b704eff587a87d6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page