{ "info": { "author": "jykntr", "author_email": "jykntr@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "rest-cli-client\r\n===============\r\nOverview\r\n--------\r\nA Python based command line REST client that makes saved REST requests and substitute values for variables that are defined in profiles or passed in as command line arguments.\r\n\r\nSetup\r\n-----\r\n1. Copy the sample restcli.conf file (see bottow of README.md) to one of the following locations:\r\n * The directory pointed to by the RESTCLI_CONF environment variable\r\n * The current directory you will be running the command from\r\n * Your users home directory\r\n\r\n2. Edit the restcli.conf file to setup any requests/profiles you'd like to use\r\n\r\nExamples\r\n--------\r\n1. Run `restcli.py` with no arguments to get a list of requests\r\n\r\n $ restcli.py\r\n usage: restcli.py [-h] {httpbinput,httpbinvars,httpbin} ...\r\n restcli.py: error: too few arguments\r\n\r\n\r\n\r\n $ restcli.py -h\r\n usage: restcli.py [-h] {httpbinput,httpbinvars,httpbin} ...\r\n\r\n optional arguments:\r\n -h, --help show this help message and exit\r\n\r\n Requests:\r\n {httpbinput,httpbinvars,httpbin}\r\n The request to execute\r\n\r\n2. Run `restcli.py {profilename} -h` to get information on the saved request\r\n\r\n $ restcli.py httpbinvars -h\r\n usage: restcli.py httpbinvars [-h] [--profile {testprofile} | --no-profile]\r\n [--proxy protocol:host:port]\r\n [--verify | --no-verify]\r\n headervar paramvar\r\n\r\n Request name: httpbinvars\r\n Method : get\r\n Headers : myheader1: {{headervar}}, myheader2: myvalue2\r\n URL : http://httpbin.org/get\r\n Parameters: myparam1={{paramvar}}, myparam2=paramvalue2\r\n Body :\r\n\r\n optional arguments:\r\n -h, --help show this help message and exit\r\n\r\n Profiles:\r\n Indicates which profile to use, if any, for variable substitution\r\n\r\n --profile {testprofile}, -p {testprofile}\r\n The name of the profile to use for variable\r\n substitution\r\n --no-profile No profile will be used for variable substitution\r\n\r\n Options:\r\n Options to use when making HTTP requests\r\n\r\n --proxy host:port\r\n Maps a protocol to a proxy. For example:\r\n \"http://proxy.url.com:8080\". Multiple proxies can be\r\n defined for different protocols.\r\n --verify Verify SSL certificates.\r\n --no-verify Do not verify SSL certificates.\r\n\r\n Required variable arguments:\r\n Variables that have no default value in the active profile (none)\r\n\r\n headervar\r\n paramvar\r\n\r\n3. Actually make the `httpbinvars` request, notice that `{{headervar}}` and `{{paramvar}}` in the request are substituted with `value1` and `value2`.\r\n\r\n $ restcli.py httpbinvars value1 value2\r\n {\r\n \"url\": \"http://httpbin.org/get?myparam2=paramvalue2&myparam1=value2\",\r\n \"headers\": {\r\n \"Accept-Encoding\": \"gzip, deflate, compress\",\r\n \"Myheader2\": \"myvalue2\",\r\n \"X-Bluecoat-Via\": \"0159f16513239b9a\",\r\n \"Myheader1\": \"value1\",\r\n \"Host\": \"httpbin.org\",\r\n \"Accept\": \"*/*\",\r\n \"User-Agent\": \"python-requests/1.2.3 CPython/2.7.3 Windows/7\",\r\n \"Connection\": \"close\",\r\n \"Cache-Control\": \"max-stale=0\"\r\n },\r\n \"args\": {\r\n \"myparam2\": \"paramvalue2\",\r\n \"myparam1\": \"value2\"\r\n },\r\n \"origin\": \"152.219.153.75\"\r\n }\r\n\r\n\r\nSample restcli.conf\r\n-------------------\r\n {\r\n \"default_profile\": \"testprofile\",\r\n \"options\": {\r\n \"verify\": false,\r\n \"proxies\": {\"http\": \"http://whatever.com:8080\"}\r\n },\r\n \"profiles\": [\r\n {\r\n \"name\": \"testprofile\",\r\n \"headervar\": \"myheadervar\",\r\n \"paramvar\": \"myparamvar\"\r\n }\r\n ],\r\n \"requests\": [\r\n {\r\n \"method\": \"get\",\r\n \"name\": \"httpbinvars\",\r\n \"url\": \"http://httpbin.org/get\",\r\n \"headers\": {\r\n \"myheader1\": \"{{headervar}}\",\r\n \"myheader2\": \"myvalue2\"\r\n },\r\n \"params\": {\r\n \"myparam1\": \"{{paramvar}}\",\r\n \"myparam2\": \"paramvalue2\"\r\n }\r\n },\r\n {\r\n \"method\": \"get\",\r\n \"name\": \"httpbin\",\r\n \"body\": \"\",\r\n \"url\": \"http://httpbin.org/get\",\r\n \"headers\": {\r\n \"myheader1\": \"myvalue1\",\r\n \"myheader2\": \"myvalue2\"\r\n },\r\n \"params\": {\r\n \"myparam1\": \"paramvalue1\",\r\n \"myparam2\": \"paramvalue2\"\r\n }\r\n },\r\n {\r\n \"method\": \"put\",\r\n \"name\": \"httpbinput\",\r\n \"body\": \"{\\\"hello\\\" : \\\"world\\\"}\",\r\n \"url\": \"http://httpbin.org/put\",\r\n \"headers\": {\r\n \"myheader1\": \"myvalue1\",\r\n \"myheader2\": \"myvalue2\"\r\n },\r\n \"params\": {\r\n \"myparam1\": \"paramvalue1\",\r\n \"myparam2\": \"paramvalue2\"\r\n }\r\n }\r\n ]\r\n }", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jykntr/rest-cli-client/releases/tag/v0.1.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jykntr/rest-cli-client", "keywords": "rest http", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "restcli", "package_url": "https://pypi.org/project/restcli/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/restcli/", "project_urls": { "Download": "https://github.com/jykntr/rest-cli-client/releases/tag/v0.1.1", "Homepage": "https://github.com/jykntr/rest-cli-client" }, "release_url": "https://pypi.org/project/restcli/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Command line REST request tool", "version": "0.1.1" }, "last_serial": 977542, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "48e872412a63bb2a64b479bdf9d02102", "sha256": "497c4edafdfbfcf0856214b1a729430c54ca092d62559eee35e10dca48c8bb66" }, "downloads": -1, "filename": "restcli-0.1.zip", "has_sig": false, "md5_digest": "48e872412a63bb2a64b479bdf9d02102", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11219, "upload_time": "2013-12-20T22:23:48", "url": "https://files.pythonhosted.org/packages/e7/5e/31537273684966fb29aa89c4979123879888bafeef4f4ba7f6df012d08d2/restcli-0.1.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "20973d323d39ea33193ce97efccd16c9", "sha256": "c912880374e2cf091bb0cdd284ba3611aa41c4614f776b8bf7d2a07bda7dcdd9" }, "downloads": -1, "filename": "restcli-0.1.1.zip", "has_sig": false, "md5_digest": "20973d323d39ea33193ce97efccd16c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11456, "upload_time": "2014-01-22T21:20:54", "url": "https://files.pythonhosted.org/packages/f5/bd/59bcff49e7f6a715ebb4f233a83835294558a415989b729201f43d3a37d3/restcli-0.1.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "20973d323d39ea33193ce97efccd16c9", "sha256": "c912880374e2cf091bb0cdd284ba3611aa41c4614f776b8bf7d2a07bda7dcdd9" }, "downloads": -1, "filename": "restcli-0.1.1.zip", "has_sig": false, "md5_digest": "20973d323d39ea33193ce97efccd16c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11456, "upload_time": "2014-01-22T21:20:54", "url": "https://files.pythonhosted.org/packages/f5/bd/59bcff49e7f6a715ebb4f233a83835294558a415989b729201f43d3a37d3/restcli-0.1.1.zip" } ] }