129 posts
Location
I honestly don't know
Posted 31 July 2014 - 01:47 AM
Does Http.Get Support PHP Redirects?
For Example I Want A Computer To Download "File.png" Using http.get("
http://example.com/redirect.php") And In The PHP File Would Be
<?php
header( 'Location: http://example.com/File.png' ) ;
?>
Will It Work?
7508 posts
Location
Australia
Posted 31 July 2014 - 01:56 AM
I could be wrong, but I'm pretty sure it doesn't, in the Java class ComputerCraft uses, in order to follow redirects you must set a flag to true, and I don't think dan has done that. you could easily test this, take a look at what the output is from the request, if it's empty then you know it's not worked.
if it doesn't work, the way around this is to have your PHP script open the image, set the header to specify an image is being delivered, and dump the image out.
129 posts
Location
I honestly don't know
Posted 31 July 2014 - 02:12 AM
The Output From The Request Was: Table: 0x24c196c8
It Should Have Been cow go moo
Any Ideas?
7508 posts
Location
Australia
Posted 31 July 2014 - 02:16 AM
okay, so you're not familiar with the HTTP API. Take a look at the return value from
http.get and you'll see why you got a table.
129 posts
Location
I honestly don't know
Posted 31 July 2014 - 02:22 AM
Thank You, I Forgot The .readAll() It's Been So Long.
But It Looks Like The PHP Redirect Is Working So I Thank You.
btw If Anyone Wants To Lock This Post They Can