Flask app that provides an API for storing and retrieving strings
Add option to use CORS
Fix README formatting


browse  log 



You can also use your local clone with git send-email.

#HTTP String Store

This is a Python Flask application which provides a simple HTTP API for storing and retrieving UTF-8 strings.

#API Documentation

The Content-Type header of requests and responses must be text/plain; charset=UTF-8.

GET /new

Returns the ID of a new string store in the response body.

POST /s/<id>

Set the string with the given ID to the string in the request body. If the given ID is not already in use the server will return a 404 Not Found error. The Server may reject strings it deems too long by returning a 413 Payload Too Large error.

GET /s/<id>

Returns the string with the given ID in the response body.

#Server Setup


  • Python 3
  • flask
  • flask-cors (optional, CORS can be disabled by editing server.py)

Clone the repository and change to it's directory.

$ python -c "import server; server.setup_database()"
$ export FLASK_APP=server.py
$ flask run

Or you can use a different WSGI server. You may edit the constants at the start of server.py to your liking.

#Example using Curl

$ curl 'http://example.org/new'
$ 'http://example.org/s/Ig7WRA4w' -H "Content-Type: text/plain; charset=UTF-8" -d "Hello, World!"
$ curl 'http://example.org/s/Ig7WRA4w'
Hello, World!