Skip to main content

PyHiAPI - Simple test API

Project description

pyhiapi

The API that just says hi!

A very simple API endpoint, easily deployable for testing purposes.

Installation

sudo pip install pyhiapi

Usage

usage: hi.py [-h] [-b BIND] [-f RESPONSE_FILE] [-p PORT] [-r CODE]

optional arguments:
  -h, --help            show this help message and exit
  -b BIND, --bind-address BIND
                        Address to bind the server to
  -f RESPONSE_FILE, --response-file RESPONSE_FILE
                        A file containing a custom response message
  -p PORT, --port PORT  The port to listen on
  -r CODE, --response_code CODE
                        The response code to send back to requests

hiapi defaults to localhost:4000 and a 200 OK response.

You can override all command line arguments using the following environment variables:

  • HIAPI_BIND_ADDR
  • HIAPI_RESPONSE_FILE
  • HIAPI_PORT
  • HIAPI_RESPONSE_CODE

When these variables are present, the corresponding command line arguments will be *completely ignored.

Testing

You can just curl the service, perhaps like this:

$ curl -i http://localhost:4000/

HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 4
Server: Werkzeug/0.9.6 Python/2.7.8
Date: Fri, 23 Jan 2015 03:38:14 GMT

Hi!

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

pyhiapi-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file pyhiapi-0.2.0.tar.gz.

File metadata

  • Download URL: pyhiapi-0.2.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for pyhiapi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 10da238f6364f3244cc29de5c603089b09beb0f1001c2000c4d084cd2ff98194
MD5 5dfc02482b0f01d63b58e0f8fa7b0033
BLAKE2b-256 e8770b2626034d1404f7f03f21d73b379410d1c6c54934723135430d9a4f9e1b

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