I'm trying to implement OAuth 2.0 into computercraft, and to do so, I have to make the following request:
http.post("https://accounts.google.com/o/oauth2/device/code", "client_id={my id here}&scope=email")
and I'm just getting a Could not connect
error
After doing some testing, I found that http.checkUrl()
works with this url, it works using curl
in terminal, and http.get("https://accounts.google.com")
works as well. It seems like the only reason this isn't working is because computercraft isn't handling POST
requests properly.
What's weird is that http.get("https://accounts.google.com/o.oauth2/device/code")
doesn't work either, which is really confusing. Although this isn't a valid request, it should succeed with a response of {"error":"Invalid request"}
, which it does when I use curl
.
Am I doing something wrong here, or is there some sort of work around?