Skip to main content

Lib for call RestApi services

Project description


This lib is used for call RestApi services.

## Installing

In your python environment use this command:

$ pip install restapi-client

Or, you can make a local clone of this repository and install with this commands:

$ python install

## Usage

Format of calls:



>> from restapi import Client
>> api = Client()
>> ret = api.<endpointname>.get()
>> api.<endpointname>.save(dict_data)
>> ret = api.<endpointname>.get("<the_id>")
>> api.<endpointname>.update("<the_id>", dict_data)
>> api.<endpointname>.delete("<the_id>")

## Methods

**save( data )**:

- **data**: dictionary parameter with the record properties

**get( [the_id] )**

- **the_id**: The id of the specific record

**update( reg_id, user_data )**

- **reg_id**: The id of the specific record
- **user_data**: dictionary parameter with properties that will be updated in
the record
- `return`: The updated record

**delete( reg_id )**

- **reg_id**: The id of the specific record to be deleted
- `return`: Nothing

### OBS:

> All methods have also the parameters _user_params_ and _user_headers_
> * _user_params_: A dictionary object, that will be passed as uri parameters, like:
> * _user_headers_: A dictionary object that wil be passwd as headers in the
> http call
> This lib does not support authentication

> All methods return a `restapi.ApiError` if the call have problems.

### Headers:

* **X-Reference-Levels**: Indicates what is the level of information that
must be returned Use the parameter `level` in the methods.

Project details

Download files

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

Files for restapi-client, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size restapi-client-0.0.1.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page