Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

[Discussion] Is there a way to do post requests in Live editor? #275

Open
VeejaLiu opened this issue Aug 1, 2024 · 0 comments
Open

[Discussion] Is there a way to do post requests in Live editor? #275

VeejaLiu opened this issue Aug 1, 2024 · 0 comments

Comments

@VeejaLiu
Copy link
Contributor

VeejaLiu commented Aug 1, 2024

[Discussion] Is there a way to do post requests in Live editor?

I'm trying to make a post request to a server in the live editor, but I can't find a way to do it.

Now I am using the os.execute function to run a curl command, It will pop up a terminal window and run the command. It's very inconvenient and ugly.
like this:

-- POST to API
local url = "http://localhost:8888/api"
local data = "data=data"
local command = string.format("curl -X POST -d \"%s\" %s", data, url)
Log(command)
local res = os.execute(command)

I want to know if there is another way to do post requests?
Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant