Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-request-response

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-request-response

The main target of this library is to standardize the request response in case of using flask-restplus library.

  • 0.0.25
  • PyPI
  • Socket score

Maintainers
1

http_request_response

Introduction
Getting Started
Contributors
License

Introduction

The main target of this library is to standardize the request response in case of using flask-restplus library.

Getting Started

In order to install, open the command prompt and type ✌️:
pip install http-request-response

In order to import:

from http_request_response import RequestUtilities

Mainly this library has two classes:

  • RequestResponse
  • RequestUtilities

The response when it is used is like the following:

Response body

{
  "status_code": ,
  "data": ,
  "message": ""
}

In order to use, the endpoint-function should be decorated with try_except decorartors:

@cls.api.route('/')
class ItemPost(Resource):
    ##### Post
    @RequestUtilities.try_except
    def post(self):
        """ Create a new record  """
        return business_obj.create(request.body_args)

You have to make sure that the function returns two items:

  • The first one is an object of status code (refer to http_status_code library)
  • JSON serializable data

Contributors

This project exists thanks to all the people who contribute. [Contribute]. ""

License

This library is licensed under the MIT License - see the LICENSE.md file for details.

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