-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Lua HTTP Client API #195
Conversation
Also updates the lua API to accept a callback
Add Post method that accepts a string body and content-type
Hi, do you have Discord? I'd like to talk to you really quick :) If you could add me |
The existing "Http.CreateConnection" can be nuked, it's not used anywhere :) |
Also updates the lua API to accept a callback
Add Post method that accepts a string body and content-type
Rebased to update to current master, if you can't pull now, try |
Currently doesn't compile for me:
|
Hi @Dreae, sorry it's been so slow. It seems like it doesn't work when the host has a trailing |
I basically joined back into the team around when you made the latest changes, so there was more than enough to do that had very high prio - but I think the way you solved this is very very neat, and it'd be cool if we could give you the contributor role in our discord so we can all chat for any possible future issues as well :) |
Is there any chance this could be merged in as part of a minor update rather than 4.0.0? This feature is super valuable, and I would love to get my hands on it as soon as possible 🙂 |
This is still in review as last time I tested it there were many issues. |
needs fixing, please reopen when ready |
@Dreae Are you planning to fix/continue/reopen this? This would be useful for my project. |
@Tcoder3 HTTP is something I've been trying to work around as well. I used to use |
@carsakiller that is a workaround I've seen others use as well, but we are aware of the bug with popen |
@Tcoder3 as far as I know this code is working. There were some minor changes requested, which I made, before the PR was closed as "needs fixing" so 🤷 |
@Dreae Would it be a bad idea to reopen the PR or @-mention the guy who closed it and say that you want to know what needs fixing or does not work? Because of cource you can't fix something you don't know about... 🤷 |
I probably wont be reopening it personally, but I'm happy to answer questions about the code or provide assistance if someone else wants to take up the torch to get it merged |
This adds lua functions for sending HTTP POST and GET requests (closes #55). The requests are sent synchronously using the current
httplib
header on aboost::asio::thread_pool
so as to not block the lua thread. The request results are returned to lua via callback functions.It supports both HTTP and HTTPS, the API looks like this:
The following overloads are available for both new methods:
There are some supporting changes to
TLuaEngine
andTLuaEngine::QueuedFunction
to support enqueuing function calls to a reference to a function on the lua stack, as well as a new overload toStateThreadData::EnqueueFunction