Lua中的游离碱API [英] Lua with the Freebase API

查看:203
本文介绍了Lua中的游离碱API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用游离碱API Lua中,但谷歌要求您使用SSL。

I need to use the Freebase API in Lua, but Google requires you to use SSL.

Lua中没有内置网络的支持,所以我必须使用像 LuaSocket 外部的东西,LuaSec`。问题是,我不能安装它们。

Lua doesn't have built-in networking support, so I have to use external stuff like LuaSocket and 'LuaSec`. The problem is that I can't install them.

我用的是ZeroBrane IDE,所以我尝试下载并把它们在 lualibs 目录,下面就以库的网站的说明。但 ssl.core ssl.context 失踪。

I use the ZeroBrane IDE, so I tried downloading and putting them in the lualibs directory, following the instructions on the libs' websites. But ssl.core and ssl.context are missing.

我在哪里可以找到他们呢?!

Where can I find them?!

推荐答案

ssl.core ssl.context 似乎是在SSL动态库本身的内部。如果您使用的是Windows,你需要做的就是把 ssl.dll &LT; ZeroBraneStudio&GT; \\ BIN \\ clibs \\ 文件夹( ssl.lua SSL \\ https.lua 已经包含在ZBS在<$ C安装$ C> lualibs 文件夹),你应该能够运行下面的例子(我只是测试它):

ssl.core and ssl.context seem to be inside the SSL dynamic library itself. If you are on Windows, all you need to do is to put ssl.dll in <ZeroBraneStudio>\bin\clibs\ folder (ssl.lua and ssl\https.lua are already included in ZBS install under lualibs folder) and you should be able to run the following example (I just tested it):

require("socket")
local https = require("ssl.https")
local body, code, headers, status = https.request("https://www.google.com")
print(status)

我贴一个更复杂的例子,这里显示的配置和握手步骤:的http://notebook.kulchenko.com/programming/https-ssl-calls-with-lua-and-luasec.

这篇关于Lua中的游离碱API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆