I've been away for a while but have an idea for a project that requires calling an API over a TLS connection.
I found the wiki page on lua-https, and it mentions that this will be part of Love 12.0, but that's probably still some time out? Is there a nightly build of 12.0 that already includes this?
I see that it should be possible to compile it myself for use with earlier versions, but that's historically not gone so we'll for me. Can someone who has done this send me their binary of https.dll for Love 11.4? That would be super. If not, then I'll probably give compiling it myself a shot over the holidays.
HTTPS
- EngineerSmith
- Prole
- Posts: 38
- Joined: Thu Dec 02, 2021 11:38 am
- Contact:
Re: HTTPS
Github actions is where all the builds are kept, you'd need a github account to access them: https://github.com/love2d/love/actions/runs/2083673514
Just scroll down to the artefacts and use what you need. Love 12.0 changes somethings like stencils and other graphics elements to do with meshes. As there is no wiki on this, so you will need to look into the source to see how to use these new changes. changes.txt include everything that's changed
Just scroll down to the artefacts and use what you need. Love 12.0 changes somethings like stencils and other graphics elements to do with meshes. As there is no wiki on this, so you will need to look into the source to see how to use these new changes. changes.txt include everything that's changed
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: HTTPS
lua-https is integrated into the love dll, in love 12. But we also have separate builds of a standalone dll for it, via github actions in the lua-https repository: https://github.com/love2d/lua-https/act ... #artifacts
Re: HTTPS
With either solution, I'm getting the same error when trying to use query parameters:
returns a code of 0. Without the query parameters,
returns 200 and a body. I didn't see any examples with query parameters, and the documentation doesn't say they need to be treated specially, but I must me doing something wrong. What is it?
Code: Select all
code, body, headers = https.request('https://api.ipify.org?format=json', {})
Code: Select all
code, body, headers = https.request('https://api.ipify.org', {})
Re: HTTPS
Never mind, I found it: If I add a slash to the end of the path, things work fine, I'll just use https://api.ipify.org/?format=json
Re: HTTPS
Looking forward to HTTPS and version 12.
Great job to everybody involved in the love2d development community!
Great job to everybody involved in the love2d development community!
Re: HTTPS
Sorry for necro-ing an old topic, but I have a question regarding HTTPS stuff with this library that is part of LÖVE 12.
I already build LÖVE 12 on my local machine and HTTPS get requests (the default) all work fine.
How would I do a POST request using this library? Can I find documentation anywhere for this library?
I already build LÖVE 12 on my local machine and HTTPS get requests (the default) all work fine.
How would I do a POST request using this library? Can I find documentation anywhere for this library?
Re: HTTPS
I believe the interface is the same as socket.http, so just provide a body for the request after the url string argument to do a POST.
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
"If each mistake being made is a new one, then progress is being made."
Re: HTTPS
Thanks ReFreezed, that works.
I also found a gist with the following code, which works fine:
I also found a gist with the following code, which works fine:
Code: Select all
local https = require "https"
do
local code, body = https.request("https://example.com")
assert(code == 200, body)
end
do
local code, body, headers = https.request("http://example.com", {method = "post", headers = {}, data = "cake"})
assert(code == 200 and headers, body)
for i, v in pairs(headers) do
print(i, v)
end
end
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests