openresty http
2024-09-06 18:32:15
openresty http
- openresty默认没有提供http客户端,需要第三方提供插件。
- 下载方式:
wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http_headers.lua
wget https://raw.githubusercontent.com/pintsized/lua-resty-http/master/lib/resty/http.lua
- 将文件放在 /openresty/lualib/resty/目录下即可
- 使用方式
local res, err = httpc:request_uri(uri, {
method = "POST/GET", ---请求方式
query = str, ---get方式传参数
body = str, ---post方式传参数
path = "url" ----路径
headers = { ---header参数
["Content-Type"] = "application/json",
}
})
最新文章
- codevs 1285 二叉查找树STL基本用法
- 初识windows程序需要了解的知识点
- 百度搜索--jquery
- Objective -C学习笔记之字典
- IOS--手势控制的使用
- Codeforces Round #198 (Div. 2)
- Linux驱动设计—— 部分系统调用函数原型
- iconv gbk字符转utf8字符
- 201521123110《Java程序与设计》第13周学习总结
- Docker &; ASP.NET Core (2):定制Docker镜像
- 初学Python:面向对象总结
- Unity3D笔记 NUGUI 一
- ZetCode PyQt4 tutorial Drag and Drop
- EffectiveJava(3)使用是由构造器或枚举类型强化singleton
- Apache + Tomcat集群 + 负载均衡
- Python之文件操作:文件、目录的操作
- [LeetCode] Permutations II 排列
- window.location.href重定向 不会触发webview
- nodejs 实践:express 最佳实践(八) egg.js 框架的优缺点
- 【转载】TCP的三次握手(建立连接)和四次挥手(关闭连接)