Metadata-Version: 2.1 Name: RestApiCall Version: 1.0.0 Summary: This python library is a REST API Call which generates REST URLs using attributes. Home-page: https://github.com/oloc/restapicall Author: Olivier Locard Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: License :: OSI Approved :: ISC License (ISCL) Description-Content-Type: text/markdown License-File: LICENSE # REST API CALL This **python** library is a REST API Call which generates REST URLs using attributes.", As an example: http://example.org/product/kart/customer?id=3&name=foo' The URI path: product/kart/customer?id=3&name=foo with this **python** library is the sequence: product.kart.customer(id='3', name='foo') ## get() You can perform the request (Cf. http://docs.python-requests.org/) with `get()`: >>> import restapicall >>> conn = restapicall.ApiCall(endpoint='http://example.org') >>> r = conn.product.kart.customer(id='3', name='foo').get() >>> r.url http://example.org/product/kart/customer?id=3&name=foo >>> r.status_code 404 >>> r.headers['content-type'] 'text/html; charset=UTF-8' ## get_url() the url can be get by `get_url()`: >>> import restapicall >>> conn = restapicall.ApiCall(endpoint='http://example.org') >>> r = conn.product(id='3').kart.customer(name='foo').get_url() >>> print(r) http://example.org/product/kart/customer?id=3&name=foo' You can concatenate the attributes. That's exactly the same: >>> conn = ApiCall(endpoint='http://example.org') >>> r = conn.product.kart.customer(id='3', name='foo').get_url() >>> print(r) http://example.org/product/kart/customer?id=3&name=foo' ## License ISC ## Author information This code was created in 2019 by Olivier Locard.