Skip to main content

Easy way to get the standard rest api response

Project description

stark-rest-apiresponse

Standard way to get the REST api response.

Install

pip install stark-rest-apiresponse

Usage

  1. Import stark-rest-apiresponse
from stark-rest-apiresponse.stark-rest-apiresponse import ApiResponse
  1. To get the response
ApiResponse.response_created(self)
ApiResponse.response_ok(self)
ApiResponse.response_internal_server_error(self)
ApiResponse.response_bad_request(self)
ApiResponse.response_unauthenticate(self)
ApiResponse.response_unauthorized(self)
ApiResponse.response_not_found(self)
ApiResponse.response_not_acceptable(self)
ApiResponse.response_not_acceptable(self)
  1. If you to change the default message:
ApiResponse.response_created(self, message='User created successfully.')
  1. Pass the data to response
data = {
	"id": 1,
	"name": "test"
}
ApiResponse.response_created(self, data=data, paginator=pagination_obj)

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

stark-rest-apiresponse-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stark_rest_apiresponse-0.0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file stark-rest-apiresponse-0.0.2.tar.gz.

File metadata

  • Download URL: stark-rest-apiresponse-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for stark-rest-apiresponse-0.0.2.tar.gz
Algorithm Hash digest
SHA256 df41ed40a55fed35f53dac1c0536655ea0cea34a173a9c5154d94a44f668dc53
MD5 f23c64a083d49ec14113386fd1db5074
BLAKE2b-256 e8a60e80de2798f5c75b52d36fa2bf9c55a36bf3cfee05fd046bef89cc8b9586

See more details on using hashes here.

File details

Details for the file stark_rest_apiresponse-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: stark_rest_apiresponse-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.9

File hashes

Hashes for stark_rest_apiresponse-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b98a26d9efbd11823578b1856f808d25eaa094822c67f11a8ecfe6866db1bb0b
MD5 fefda85239464c08011533a39337e1c7
BLAKE2b-256 4ade3dd87f5dbf90b3946ad5940c43a9f0276fe0d585795e3390c49eb9b4eaeb

See more details on using hashes here.

Supported by

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