Socket
Socket
Sign inDemoInstall

jsonrequest

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonrequest

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


Maintainers
1

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 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. Here's a medium article of how I created this package as a result. Hope this helps and Happy coding :)

  • by Justin

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc