tree: cd72c73a817419bd234dfa71c10abd1eb4e3386a [path history] [tgz]
  1. README.md
  2. server.py
http/get_indirect/python/server/README.md

HTTP GET Arrow Data: Indirect Python Server Example

This directory contains an example of an HTTP server implemented in Python using the built-in http.server module. The server:

  1. Listens for HTTP GET requests from clients.
  2. Upon receiving a GET request for the document root, serve a JSON document that lists the URIs of all the .arrows files in the current directory.
  3. Upon receiving a GET request for a specific .arrows file, serve that file.

To run this example, first copy two .arrows files from the data section of this repository into the current directory:

cp ../../../../data/arrow-commits/arrow-commits.arrows .
cp ../../../../data/rand-many-types/random.arrows .

Then start the HTTP server:

python server.py

In this example, the JSON document listing the URIs of the .arrows files is structured as shown below. This JSON structure is provided for example purposes only. It is not a recommendation. Developers should use JSON document structures appropriate to the needs of their applications.

{
    "arrow_stream_files": [
        {
            "uri": "http://127.0.0.1:8008/random.arrows"
        },
        {
            "uri": "http://127.0.0.1:8008/arrow-commits.arrows"
        }
    ]
}