restcall


Namerestcall JSON
Version 1.2.0 PyPI version JSON
download
home_page
SummaryA small JSON-based command-line utility to make REST calls
upload_time2023-11-30 07:30:12
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2021 Subhadip Ghosh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords rest client cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # restcall
A small JSON-based command-line utility to make REST calls.

## Installation
`restcall` is distributed as a Python package and can be installed using `pip`.
```
python -m pip install restcall
```

## Usage

### Generate a template
```
restcall -t get-service-name.json

restcall -t post-service-name.json
```

### Import template from curl command
```
restcall -u curl-command.txt get-service-name.json
```
The `curl-command.txt` file contains the curl command.

### Modify the generated template

The generated template looks like this:

```json
{
    "url": "",
    "httpMethod": "POST",
    "reqAuthType": "none",
    "reqAuthToken": "",
    "reqContentType": "",
    "reqHeaders": {},
    "reqPayload": "",
    "resFile": ""
}
```
Edit the template and populate the required values.
Here are the parameters, their meaning and the allowed values:
- url - the REST URL
- httpMethod - GET, POST, PUT, PATCH, DELETE
- reqAuthType - `none`, `bearer`, `bearer_generate`, `basic`
- reqAuthToken
    - the actual token if the reqAuthType is `bearer`
    - filepath to the restcall template to generate the token if the reqAuthType is `bearer_generate`
    - `username:password` if the reqAuthType is `basic`
- reqContentType - the request content type. eg. `application/json`
- reqHeaders - the request headers
- reqPayload - the request body. If binary, provide the file path.
- resFile - the file path for storing response externally

### Make the REST call
```
restcall get-service-name.json
```

It will generate the response file `get-service-name-res.json`.

### Output equivalent curl command:
```
restcall -c get-service-name.json
```

## SSL
By default SSL certificate verification is disabled.

## License
This repository and the files under it are licensed under the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "restcall",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "rest,client,cli",
    "author": "",
    "author_email": "Subhadip Ghosh <subhadip.sky@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f2/24/c002d800cd59eac38eb45592f88a217e65c07eb1e9b2c7174d4549748bdc/restcall-1.2.0.tar.gz",
    "platform": null,
    "description": "# restcall\nA small JSON-based command-line utility to make REST calls.\n\n## Installation\n`restcall` is distributed as a Python package and can be installed using `pip`.\n```\npython -m pip install restcall\n```\n\n## Usage\n\n### Generate a template\n```\nrestcall -t get-service-name.json\n\nrestcall -t post-service-name.json\n```\n\n### Import template from curl command\n```\nrestcall -u curl-command.txt get-service-name.json\n```\nThe `curl-command.txt` file contains the curl command.\n\n### Modify the generated template\n\nThe generated template looks like this:\n\n```json\n{\n    \"url\": \"\",\n    \"httpMethod\": \"POST\",\n    \"reqAuthType\": \"none\",\n    \"reqAuthToken\": \"\",\n    \"reqContentType\": \"\",\n    \"reqHeaders\": {},\n    \"reqPayload\": \"\",\n    \"resFile\": \"\"\n}\n```\nEdit the template and populate the required values.\nHere are the parameters, their meaning and the allowed values:\n- url - the REST URL\n- httpMethod - GET, POST, PUT, PATCH, DELETE\n- reqAuthType - `none`, `bearer`, `bearer_generate`, `basic`\n- reqAuthToken\n    - the actual token if the reqAuthType is `bearer`\n    - filepath to the restcall template to generate the token if the reqAuthType is `bearer_generate`\n    - `username:password` if the reqAuthType is `basic`\n- reqContentType - the request content type. eg. `application/json`\n- reqHeaders - the request headers\n- reqPayload - the request body. If binary, provide the file path.\n- resFile - the file path for storing response externally\n\n### Make the REST call\n```\nrestcall get-service-name.json\n```\n\nIt will generate the response file `get-service-name-res.json`.\n\n### Output equivalent curl command:\n```\nrestcall -c get-service-name.json\n```\n\n## SSL\nBy default SSL certificate verification is disabled.\n\n## License\nThis repository and the files under it are licensed under the MIT license.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 Subhadip Ghosh  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A small JSON-based command-line utility to make REST calls",
    "version": "1.2.0",
    "project_urls": {
        "Changelog": "https://github.com/subhadig/restcall/blob/master/CHANGELOG.md",
        "Homepage": "https://github.com/subhadig/restcall"
    },
    "split_keywords": [
        "rest",
        "client",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8dc0fc3b6e89fa29151ebe83f9a3e95fc347b4db2f95de24cd986a474a537b62",
                "md5": "0e9f9ad938229ada9a466152b61dd73b",
                "sha256": "d7dea6eace9585323f534cc42e1638ee7ee45f350ffe04f73d8b9410e364454a"
            },
            "downloads": -1,
            "filename": "restcall-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e9f9ad938229ada9a466152b61dd73b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10015,
            "upload_time": "2023-11-30T07:30:09",
            "upload_time_iso_8601": "2023-11-30T07:30:09.766578Z",
            "url": "https://files.pythonhosted.org/packages/8d/c0/fc3b6e89fa29151ebe83f9a3e95fc347b4db2f95de24cd986a474a537b62/restcall-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f224c002d800cd59eac38eb45592f88a217e65c07eb1e9b2c7174d4549748bdc",
                "md5": "449d6e998c3472f2ed8d8512e4673043",
                "sha256": "2c9b53b4ff3baa7b4d7b71ff57fb66087eb693777777b6e218286332c2b3887d"
            },
            "downloads": -1,
            "filename": "restcall-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "449d6e998c3472f2ed8d8512e4673043",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8847,
            "upload_time": "2023-11-30T07:30:12",
            "upload_time_iso_8601": "2023-11-30T07:30:12.122603Z",
            "url": "https://files.pythonhosted.org/packages/f2/24/c002d800cd59eac38eb45592f88a217e65c07eb1e9b2c7174d4549748bdc/restcall-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-30 07:30:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "subhadig",
    "github_project": "restcall",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "restcall"
}
        
Elapsed time: 0.15950s