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",
}
})

最新文章

  1. codevs 1285 二叉查找树STL基本用法
  2. 初识windows程序需要了解的知识点
  3. 百度搜索--jquery
  4. Objective -C学习笔记之字典
  5. IOS--手势控制的使用
  6. Codeforces Round #198 (Div. 2)
  7. Linux驱动设计—— 部分系统调用函数原型
  8. iconv gbk字符转utf8字符
  9. 201521123110《Java程序与设计》第13周学习总结
  10. Docker & ASP.NET Core (2):定制Docker镜像
  11. 初学Python:面向对象总结
  12. Unity3D笔记 NUGUI 一
  13. ZetCode PyQt4 tutorial Drag and Drop
  14. EffectiveJava(3)使用是由构造器或枚举类型强化singleton
  15. Apache + Tomcat集群 + 负载均衡
  16. Python之文件操作:文件、目录的操作
  17. [LeetCode] Permutations II 排列
  18. window.location.href重定向 不会触发webview
  19. nodejs 实践:express 最佳实践(八) egg.js 框架的优缺点
  20. 【转载】TCP的三次握手(建立连接)和四次挥手(关闭连接)

热门文章

  1. Cortex-A8/A76
  2. 019.MFC_两种对话框
  3. 使用svndumpfilter exclude来清理svn库的废弃文件实现差别备份
  4. NFS服务介绍及实验
  5. 登录密码忘记修改jenkins
  6. 在nginx里面部署node.js本地服务器
  7. linux技巧---创建应用快捷方式
  8. 软考网络工程师、软件设计师等官方指定教材pdf文件
  9. 11.在Chrome谷歌浏览器中安装插件XPath Helper的方法
  10. 手把手带你了解消息中间件(2)——RabbitMQ