Skip to main content

session request

PyPI PyPI - Downloads PyPI - Python Version PyPI - License

以类的形式封装请求接口,支持requests所有参数

Github: https://github.com/mouday/session-request

pypi: https://pypi.org/project/session-request

安装

pip install session-request

使用

# -*- coding: utf-8 -*-

from session_request import Request


class ClientApi(Request):
    def after_request(self, response):
        """请求后 响应处理器"""
        return response.json()

    def get_request(self):
        options = {
            'path': '/get'
        }
        return self.get(**options)


if __name__ == '__main__':
    base_url = 'http://httpbin.org'
    api = ClientApi(base_url=base_url)
    res = api.get_request()
    print(res['url'])
    # http://httpbin.org/get

Metadata

Release files for session-request 0.0.4

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

Source distribution (sdist)

Source distribution for session-request 0.0.4
File Size Uploaded Provenance Actions
session-request-0.0.4.tar.gz 3.1 kB Without provenance Details for session-request-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for session-request 0.0.4
File Interpreter ABI Platform Actions
session_request-0.0.4-py3-none-any.whl Python 3 none any Details for session_request-0.0.4-py3-none-any.whl

Total release size: 6.4 kB

Release files / session-request-0.0.4.tar.gz

Download URL session-request-0.0.4.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7d8157e2316b4863cf2a7cf1f575303577d2952da1844fe3bb1fd7668206b4da
BLAKE2b-256 checksum
How to use checksums
20312d7d01c2cb8faeac96cc173e72b7e52d3329285299685c40d4cdd9c763b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.0

Release files / session_request-0.0.4-py3-none-any.whl

Download URL session_request-0.0.4-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c629d00f5e8fc22bff514b42bdfc69be79c157a8d9a445e240832bd564b5492
BLAKE2b-256 checksum
How to use checksums
1668b8c4faa12e59c11939ca78d9c045ac936d69b1cbb288138ac4c56c50a7d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.0

Security for session-request 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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