{ "info": { "author": "Anton Baklanov", "author_email": "antonbaklanov@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "## What is it?\n\nSilly Server can help you to mock some HTTP services which are not implemented yet, but you are really want to use them NOW.\n\nIt can mock GET, POST, PUT, DELETE and some more rarely used HTTP methods. \n\n## How?\n\nMocking service is as simple as creating directory and few files within it just like that:\n\n somedir/\n GET # response content for GET /\n GET_H # status and headers for GET /\n other_dir/\n GET # response content for GET /other_dir\n POST # response content for POST /other_dir\n POST_H # status and headers for POST /other_dir\n\nAnd then running silly server:\n\n ./ss.py -d /path/to/somedir\n\nReady! It will be listening on port 8000 *(can be changed with -p option)* and wait for your HTTP requests.\nYou can do:\n \n $ curl localhost:8000\n % whatever you put into somedir/GET file %\n\n $ curl -d \"postparam=value¶ram=25\" -X POST \"localhost:8000/other_dir?someparam=value\"\n % somedir/other_dir/POST content% \n\nMeanwhile in terminal where you launched ss.py some logs will appear:\n\n localhost - - [19/Oct/2012 13:23:03] \"POST /other_dir?someparam=value HTTP/1.1\" 200 -\n\n Got some GET params here:\n someparam: ['value']\n\n Got some payload:\n postparam: ['value']\n pararam: ['25']\n\nYou can specify response status and headers within GET\\_H, POST\\_H, %yourmethod%\\_H files. Format is simple:\n\n 403\n content-type: text/html\n cool-header: i'm cool\n\nSo, first line is status code, other lines are headers.\n\n## Check example!\n\nFollowing urls are mocked:\n\n GET / # 400 Bad Request.\n GET /user # 200. Returns json with users list.\n GET /user/john/status # 200. Returns json with John's status.\n GET /user/anonymous/status # 403. You can't see this.\n POST /user # 200. Returns some json.\n\nAny other requests will return default response.\n\nCheck it out:\n\n % ./ss.py -d example\n\n # go to other terminal\n\n % curl -X GET -v localhost:8000 \n < HTTP/1.0 400 Bad Request\n < cool-header: OLOLO\n < \n Your request was very bad.\n\n\n % curl -X GET -v localhost:8000/user/\n < HTTP/1.0 200 OK\n < whats-here: users list\n < \n {\n \"users\": [\"john\", \"anonymous\"]\n }\n\n\n % curl -X GET -v localhost:8000/user/john/status \n < HTTP/1.0 200 OK\n < \n {\n \"status\": \"drunk\"\n }\n\n\n % curl -X GET -v localhost:8000/user/anonymous/status\n < HTTP/1.0 403 Forbidden\n < \n You can't get status of anonymous, he is anonymous. lol.\n\n\n % curl -X POST -d \"param=value&other_param=25\" localhost:8000/user\n < HTTP/1.0 200 OK\n < content-type: maybe some json is here\n < \n {\n \"whatsup\": \"You just posted something.\"\n }\n\n\nHave fun!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bak1an/silly-server", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "silly-server", "package_url": "https://pypi.org/project/silly-server/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/silly-server/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bak1an/silly-server" }, "release_url": "https://pypi.org/project/silly-server/0.2/", "requires_dist": null, "requires_python": null, "summary": "One more silly server for mocking HTTP services", "version": "0.2" }, "last_serial": 774608, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3e5c7f49bada2c37dde5a6eff6c0810f", "sha256": "f1f948d868c65972e7683fc449f74731df5d770b7f8e0cdf9fd61a181bdf2bb6" }, "downloads": -1, "filename": "silly-server-0.1.tar.gz", "has_sig": false, "md5_digest": "3e5c7f49bada2c37dde5a6eff6c0810f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5751, "upload_time": "2013-06-19T13:21:18", "url": "https://files.pythonhosted.org/packages/d8/b9/26c061378b198e45810f867c705398eeb226517dba82b98cad22841209b9/silly-server-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "760ef5c238873588288d14d438ee38ec", "sha256": "75d62a6a5cbbbf715b3092cb170a48c9a3c1af91ffcd759288673ee3c8697b8f" }, "downloads": -1, "filename": "silly-server-0.2.tar.gz", "has_sig": false, "md5_digest": "760ef5c238873588288d14d438ee38ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6088, "upload_time": "2013-06-19T13:41:17", "url": "https://files.pythonhosted.org/packages/c2/27/f3c8eff0e288f701028d32d1f341016abd6439e114564a91f2b1e72346cd/silly-server-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "760ef5c238873588288d14d438ee38ec", "sha256": "75d62a6a5cbbbf715b3092cb170a48c9a3c1af91ffcd759288673ee3c8697b8f" }, "downloads": -1, "filename": "silly-server-0.2.tar.gz", "has_sig": false, "md5_digest": "760ef5c238873588288d14d438ee38ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6088, "upload_time": "2013-06-19T13:41:17", "url": "https://files.pythonhosted.org/packages/c2/27/f3c8eff0e288f701028d32d1f341016abd6439e114564a91f2b1e72346cd/silly-server-0.2.tar.gz" } ] }