-
-
Notifications
You must be signed in to change notification settings - Fork 138
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 HTTP client function (GET/POST/etc.) #33
Comments
With the HTTPClient():Get("http://www.guimp.com/") Or by using a variable for the HTTPClient: hc = HTTPClient()
hc:Get("http://www.guimp.com/") Or with URL arguments: HTTPClient():Get("https://jsonplaceholder.typicode.com/comments", {postId=1, id=2}) Or with URL arguments and HTTP headers: HTTPClient():Get("https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending", {x=42}, {["X-PoweredBy"]="Bits and bytes"}):match('POWEREDBY.*</td>') Or POST requests like this: HTTPClient():Post("https://jsonplaceholder.typicode.com/posts", {}, {["Content-type"]="application/json; charset=UTF-8"}, JSON({title="foo", body="bar", userId=1})) Does this seem like a somewhat viable approach, or is it too verbose? |
I think this is a good approach. The verbosity is a good balance of flexibility and simplicity. Any reason to have to instantiate an object versus just having an httprequest function? Are there any stateful parameters or other methods? Looks like only autonomous function calls. |
I added Unfortunately, the HTTPClient settings like timing and language seems to be possible to set only once, so I'll have to restructure how the object is stored before this will work, before merging. |
Closing this issue as fixed, please re-open this issue if there should be further issues with this. |
Would it be possible to add a function inside of Lua for http GET, POST, etc.? This could be used for:
I actually have a need for all 3 of these things. Could be built using a plugin, but it feels like something that would be relatively easy to build in and provide a lot of potential functionality.
The text was updated successfully, but these errors were encountered: