jsonrequest


Namejsonrequest JSON
Version 0.1.7 PyPI version JSON
download
home_page
SummaryLightweight wrapper to make http(s) requests. POST, PATCH, and DELETE requests only support json content.
upload_time2023-06-26 08:09:30
maintainer
docs_urlNone
authorJustin Wong
requires_python>=3.2
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # [JSONRequest](https://pypi.org/project/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
```bash
pip install jsonrequest
```

Then, you can use the package.
```python
>>> 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](https://medium.com/@justinryanwong/creating-and-releasing-a-new-pypi-package-20218f316aef) of how I created this package as a result. Hope this helps and Happy coding :)

- by Justin

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "jsonrequest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.2",
    "maintainer_email": "",
    "keywords": "",
    "author": "Justin Wong",
    "author_email": "Justin Wong <justinryanwong@berkeley.edu>",
    "download_url": "https://files.pythonhosted.org/packages/0c/b6/dae01e42b373f442c085d3a4c0901c15e5e203026e907ce331f40fe18c18/jsonrequest-0.1.7.tar.gz",
    "platform": null,
    "description": "# [JSONRequest](https://pypi.org/project/jsonrequest/)\nLightweight wrapper for requests library that only supports Content-Type: application/json.\n\nThis only supports `GET`, `POST`, `PATCH`, and `DELETE` http(s) request methods.\n\n## How to Use\n\nFirst, install the package\n```bash\npip install jsonrequest\n```\n\nThen, you can use the package.\n```python\n>>> from jsonrequest import RequestModel, make_request\n>>> r = make_request(RequestModel(endpoint=\"\", method='GET', url='https://google.com'))\n>>> r\n<Response [200]>\n>>> \n```\n\n## Note:\nThis data passed also only applies to `application/json` content.\n\n\nAcross 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](https://medium.com/@justinryanwong/creating-and-releasing-a-new-pypi-package-20218f316aef) of how I created this package as a result. Hope this helps and Happy coding :)\n\n- by Justin\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Lightweight wrapper to make http(s) requests. POST, PATCH, and DELETE requests only support json content.",
    "version": "0.1.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/JustinRWong/JSONRequest/issues",
        "Homepage": "https://github.com/JustinRWong/JSONRequest"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cb6dae01e42b373f442c085d3a4c0901c15e5e203026e907ce331f40fe18c18",
                "md5": "031a922bed834c7eed9bc4002e94acf7",
                "sha256": "02a13e2e42fc1ebca518322b32771ed65fe416bf6ae265e3dd7b2ff41d12041a"
            },
            "downloads": -1,
            "filename": "jsonrequest-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "031a922bed834c7eed9bc4002e94acf7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.2",
            "size": 2593,
            "upload_time": "2023-06-26T08:09:30",
            "upload_time_iso_8601": "2023-06-26T08:09:30.920042Z",
            "url": "https://files.pythonhosted.org/packages/0c/b6/dae01e42b373f442c085d3a4c0901c15e5e203026e907ce331f40fe18c18/jsonrequest-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-26 08:09:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JustinRWong",
    "github_project": "JSONRequest",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jsonrequest"
}
        
Elapsed time: 0.13421s