Skip to main content

Formatted APIs presentation for testing.

Project description

# Formatted APIs presentation for testing
Can be used as part of RESTful API test framework

# Install
sudo pip3 install restapi3

# Usage
1. 'Get' : 'query_strings'
1. 'Post' : 'data', 'files', 'json'
1. 'Put' : 'data', 'json'
1. 'Delete'

from restapi3.api import BaseAPIs, API

class Video_Model(BaseAPIs):

def __init__(self):
BaseAPIs.__init__(self, "http://XXXX")
self.headers = {'X-Device-ID': 'YA'}

def get_video(self):
return {
'path': '/v1/A/C/X',
'headers': self.headers,
'method': 'Get',
'query_strings': {
'first_str': 'val space, yee',
'second_str': 123
'json': {
'a': 123,
'b': ['123', '234']
'files': {
'image': open('/Users/tedchen/Desktop/test.png', 'rb')

r = Video_Model().get_video() # Return for requests Response object

if r.status_code != 200:
raise Exception("Fail to call API")
r_json = r.json()

Project details

Release history Release notifications

This version


Download files

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

Files for restapi3, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size restapi3-0.0.1-py3-none-any.whl (4.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page