在LUA中调用Rest API端点 [英] Invoke Rest api end point in LUA
本文介绍了在LUA中调用Rest API端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从我的Lua脚本中调用Rest API端点.我怎样才能做到这一点?例如,我可以通过以下curl命令调用端点:
I need to invoke a Rest API endpoint from my Lua script. How can I do that? For example, I am able to invoke the endpoint by the below curl command:
curl -X GET \
-H "X-Parse-Application-Id: ParseAppID" \
-H "X-Parse-REST-API-Key: RESTAPIKey" \
https://api.parse.com/1/classes/GameScore
我在 Lua 中想要的一样.
The same I wanted in Lua.
推荐答案
Lua本身不能调用该终结点,因为标准网络不支持https.您将需要使用3rd-party库,我建议使用Lua-cURL.您将需要下载并安装它.
Lua by itself cannot call that endpoint, since the standard networking doesn't support https. You will need to use a 3rd-party library, I suggest Lua-cURL. You will need to download and install it.
这篇关于在LUA中调用Rest API端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文