Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

amplify-education/minirest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RCUBIC

Introduction

MiniREST is a small framework for sending and receiving POST messages with SSL and token authentication.

Getting Started

Installation

Prerequisites

How to install

  1. Use setup.py

Usage guide

Server

The sever uses pywsgi. Extend the RESTSever class, implement local methods, and register them. URLs are only routed to functions based on the first value: ie "http://ip/hello" and "http://ip/hello/meow" will both be forwarded to the same callback function.

Client

The client uses python-requests. Extend the RESTClient class, and implement local methods. You can specify the address/port for each call. If they are not specified the default will be used. Arguments can be passed in as a dictionary of "string -> int/string".

Authentication

If SSL is turned on, the Server will listen for SSL connections. A token can be used to limit access to function calls from the outside. The client will receive an SSLError if the SLL authentication fails, a ConnectionError when trying to connect to an SSL server without using SSL, and a 403 message 'Bad Token', if the token doesn't match.

Examples

Please take a look at example_server.py, example_client.py, and tests.py.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published