Skip to main content

requests extension for noseapp lib

Project description

Requests/Requests-Oauthlib extension for NoseApp library

Installation

pip install noseapp_requests

Usage

from noseapp.ext.requests import RequestsEx, make_config

endpoint = make_config()
endpoint.configure(
  base_url='http://httpbin.org/',
  key='httpbin'
)
endpoint.session_configure(
  always_return_json=True,
  raise_on_http_error=True
)
requests_ex = RequestsEx(endpoint)
api = requests_ex.get_endpoint_session('httpbin', auth=('user', 'pass'))
api.get('basic-auth/user/pass')
api.get('get', key1='val1') # GET with query-string parameters
api.post('post', key1='val1') # POST form-encoded data
api.post('post', {'key1': 'val1'}) # POST JSON data
api.get('status/400') # raises HTTPError

Documentation

http://noseapp-requests.readthedocs.org/

Project details


Download files

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

Source Distribution

noseapp_requests-0.0.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page