This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
roger109z's profile picture

http post

Started by roger109z, 28 August 2016 - 06:06 PM
roger109z #1
Posted 28 August 2016 - 08:06 PM
how do I handle http.post requests server side?
KingofGamesYami #2
Posted 28 August 2016 - 08:21 PM
What type of server are you using? PHP? Java? Something else? It varies depending on the language.
roger109z #3
Posted 28 August 2016 - 08:23 PM
php it interacts with CC the best (as far as I know)
KingofGamesYami #4
Posted 28 August 2016 - 08:33 PM
In that case, I'll direct you to php.net.
TheRockettek #5
Posted 28 August 2016 - 08:46 PM
http://php.net/manual/en/reserved.variables.post.php

Yep it is like _GET :P/>
MKlegoman357 #6
Posted 28 August 2016 - 09:41 PM
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.
roger109z #7
Posted 28 August 2016 - 09:48 PM
why thank you good person
Emma #8
Posted 31 August 2016 - 12:55 AM
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 on 04 September 2016 - 01:10 AM
Lyqyd #9
Posted 31 August 2016 - 01:06 AM
That's no longer the case, as far as I'm aware.
Anavrins #10
Posted 31 August 2016 - 02:14 AM
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".
Emma #11
Posted 04 September 2016 - 02:32 AM
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 on 04 September 2016 - 01:10 AM