{"id":13636298,"url":"https://github.com/liseen/lua-resty-http","last_synced_at":"2025-04-19T08:31:53.965Z","repository":{"id":2955335,"uuid":"3969385","full_name":"liseen/lua-resty-http","owner":"liseen","description":"Lua http client driver for the ngx_lua based on the cosocket API","archived":false,"fork":false,"pushed_at":"2017-06-23T11:49:07.000Z","size":49,"stargazers_count":188,"open_issues_count":12,"forks_count":71,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-02-14T17:31:43.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liseen.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-09T05:45:47.000Z","updated_at":"2023-12-11T06:17:20.000Z","dependencies_parsed_at":"2022-09-04T12:52:21.037Z","dependency_job_id":null,"html_url":"https://github.com/liseen/lua-resty-http","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liseen%2Flua-resty-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liseen%2Flua-resty-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liseen%2Flua-resty-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liseen%2Flua-resty-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liseen","download_url":"https://codeload.github.com/liseen/lua-resty-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223795219,"owners_count":17204135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T00:00:59.606Z","updated_at":"2024-11-09T06:30:15.913Z","avatar_url":"https://github.com/liseen.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"Name\n====\n\nlua-resty-http - Lua http client driver for the ngx_lua based on the cosocket API\n\nStatus\n======\n\nThis library is considered experimental and still under active development.\n\nThe API is still in flux and may change without notice.\n\nDescription\n===========\n\nThis Lua library is a http client driver for the ngx_lua nginx module:\n\nhttp://wiki.nginx.org/HttpLuaModule\n\nThis Lua library takes advantage of ngx_lua's cosocket API, which ensures\n100% nonblocking behavior.\n\nNote that at least [ngx_lua 0.5.0rc3](https://github.com/chaoslawful/lua-nginx-module/tags) or [ngx_openresty 1.0.11.3](http://openresty.org/#Download) is required.\n\nSynopsis\n========\n\n    lua_package_path \"/path/to/lua-resty-http/lib/?.lua;;\";\n\n    server {\n        location /test {\n            content_by_lua '\n                local http = require \"resty.http\"\n                local hc = http:new()\n\n                local ok, code, headers, status, body  = hc:request {\n                    url = \"http://www.qunar.com/\",\n                    --- proxy = \"http://127.0.0.1:8888\",\n                    --- timeout = 3000,\n\t\t\t\t\t--- scheme = 'https',\n                    method = \"POST\", -- POST or GET\n                    -- add post content-type and cookie\n                    headers = { Cookie = {\"ABCDEFG\"}, [\"Content-Type\"] = \"application/x-www-form-urlencoded\" },\n                    body = \"uid=1234567890\",\n                }\n\n                ngx.say(ok)\n                ngx.say(code)\n                ngx.say(body)\n            ';\n        }\n    }\n\nTODO\n====\n\n* implement the redirect supported\n* implement the chunked\n* implement the keepalive\n\nAuthors\n=======\n\n\"liseen\" \u003cliseen.wan@gmail.com\u003e\n\n\"wendal\" \u003cwendal1985@gmail.com\u003e\n\n\"wangchll\" \u003cwangchong1985@gmail.com\u003e\n\nCopyright and License\n=====================\n\nThis module is licensed under the BSD license.\n\nCopyright (C) 2012, by Zhang \"agentzh\" Yichun (章亦春) \u003cagentzh@gmail.com\u003e.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nSee Also\n========\n* the ngx_lua module: http://wiki.nginx.org/HttpLuaModule\n* the memcached wired protocol specification: http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt\n* the [lua-resty-redis](https://github.com/agentzh/lua-resty-redis) library.\n* the [lua-resty-mysql](https://github.com/agentzh/lua-resty-mysql) library.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliseen%2Flua-resty-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliseen%2Flua-resty-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliseen%2Flua-resty-http/lists"}