Skip to main content

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.

Metadata

Release files for http-request-response 0.0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for http-request-response 0.0.25
File Size Uploaded
http_request_response-0.0.25.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for http-request-response 0.0.25
File Interpreter ABI Platform
http_request_response-0.0.25-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / http_request_response-0.0.25.tar.gz

Download URL http_request_response-0.0.25.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0ad6beb0384307de619b64e012bf54f01add7ca7db3324d80f2a935e50bce5de
BLAKE2b-256 checksum
How to use checksums
caf144f8f20401fafbc678f7b5fb210e8b474f2a5c304ff8735ad3ba0eef29de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / http_request_response-0.0.25-py3-none-any.whl

Download URL http_request_response-0.0.25-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ccddad52320cafe746d4ae41ef6234bb479a61b6f946c08e11736facbceabcc
BLAKE2b-256 checksum
How to use checksums
6b372d9f3d7e41b752ace91e8894c495da973f251dd04b5903069f77037f8abc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.25 This release

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page