Skip to main content

Lightweight wrapper to make http(s) requests. POST, PATCH, and DELETE requests only support json content.

Project description

JSONRequest

Lightweight wrapper for requests library that only supports Content-Type: application/json.

This only supports GET, POST, PATCH, and DELETE http(s) request methods.

How to Use

First, install the package

pip install jsonrequest

Then, you can use the package.

>>> from jsonrequest.jsonrequest import RequestModel, make_request
>>> r = make_request(RequestModel(endpoint="", method='GET', url='https://google.com'))
>>> r
<Response [200]>
>>> 

Note:

This data passed also only applies to application/json content.

Across multiple times over the past many years in my python projects, I found this codeblock repeated whenever I tried to make various http(s) requests using the requests library and thought it'd be much simpler to pass the method as a parameter instead of changing the function. I created this package as a result. Hope this helps and Happy coding :)

  • by Justin

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

jsonrequest-0.1.3.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

jsonrequest-0.1.3-py3-none-any.whl (1.6 kB view hashes)

Uploaded Python 3

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