←  Ask a Pro

ComputerCraft | Programmable Computers for Minecraft

»

http post

roger109z's Photo roger109z 28 Aug 2016

how do I handle http.post requests server side?
Quote

KingofGamesYami's Photo KingofGamesYami 28 Aug 2016

What type of server are you using? PHP? Java? Something else? It varies depending on the language.
Quote

roger109z's Photo roger109z 28 Aug 2016

php it interacts with CC the best (as far as I know)
Quote

KingofGamesYami's Photo KingofGamesYami 28 Aug 2016

In that case, I'll direct you to php.net.
Quote

MKlegoman357's Photo MKlegoman357 28 Aug 2016

ComputerCraft's http.post() sends a generic POST request to the server, so a simple Google search of "How to handle post request in PHP" should give you enough information about how to handle it.
Quote

roger109z's Photo roger109z 28 Aug 2016

why thank you good person
Quote

Emma's Photo Emma 30 Aug 2016

Just something to keep in mind, cc can't make https requests, any attempt to route traffic through https will be redirected to http.
Edited by Incinirate, 04 September 2016 - 02:10 AM.
Quote

Lyqyd's Photo Lyqyd 31 Aug 2016

That's no longer the case, as far as I'm aware.
Quote

Anavrins's Photo Anavrins 31 Aug 2016

View PostIncinirate, on 30 August 2016 - 11:55 PM, said:

Just something to keep in mind, cc can't make https requests, any attempt to route traffic through https will be redirected to http.
That's false, I can connect to https twitter, and as far as I know it's https only, Wiresharks also tells me that the connection was made over TLS.
The only issue I had with https pages not loading in CC (and OC for that matter) is when a certificate is signed with an authority that isn't in Java's truststore, such as "Let's Encrypt".
Quote

Emma's Photo Emma 04 Sep 2016

Hm, very strange, last time I checked, my traffic was re-routed through http, I knew this because the server I was interfacing with rejects plain http. Although it's probably because I was using an emulator, I'll test it in-game real quick and edit my post.

Edit: Yep, just tested in-game and it works, please disregard my previous post.
Edited by Incinirate, 04 September 2016 - 02:10 AM.
Quote