The Movie Database atbalsts

Hello,

I need some help with your api. I constantly get a connection timed out error. Below is my code, I'm trying to just output the raw json respone so i can work my way from there.

$header_opt = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept: application/json\r\n" .
            "Content-Type: application/json\r\n"
  )
);

$headers = stream_context_create($header_opt);

$rawjson = file_get_contents('http://api.themoviedb.org/3/movie/tt0076759?api_key=myapikey', false, $headers);

$cleansjon = json_decode($rawjson);

echo $cleansjon;

And this is the error I get.

Warning: file_get_contents(http://api.themoviedb.org/3/movie/tt0076759?api_key=myapikey) [function.file-get-contents]: failed to open stream: Connection timed out in /*///*/public_html/index.php on line 11

I hope that someone can help me with this.

2 replies (on page 1 of 1)

Jump to last post

Bumb...

I still dont have an answer to my question above. Is there anyone that can help me with my problem ?

Hi Tony,

Unfortunately, I don't have a clue why you're seeing this. You could try using one of the PHP libraries just to see if you see the same behaviour. If you do, then I would guess it's something more server related than anything. If not, you can pick apart the code to see what the libraries do different than you are.

Nevari atrast filmu vai TV pārraidi? Jāpiesakās, lai to izveidotu.

Vispārējs

s fokusēties uz meklēšanas joslu
p atvērt profila izvēlni
esc aizvērt atvērtu logu
? atvērt īsinājumtaustiņu logu

Informācijas nesēju lapās

b atgriezties (vai pie vecākiem, ja nepieciešams)
e doties uz labošanas lapu

TV sezonas lapās

(labā bultiņa) pāriet uz nākamo sezonu
(kreisā bultiņa) pāriet uz iepriekšējo sezonu

TV sērijas lapās

(labā bultiņa) pāriet uz nākamo sēriju
(kreisā bultiņa) pāriet uz iepriekšējo sēriju

Visās attēlu lapās

a atvērt attēla pievienošanas logu

Visās labošanas lapās

t atvērt tulkošanas atlasītāju
ctrl+ s iesniegt veidlapu

Diskusiju lapās

n radīt jaunu diskusiju
w pārslēgt skatīšanās stāvokli
p pārslēgt publisko/privāto
c pārslēgt aizvērt/atvērt
a atklāta darbība
r atbilde uz diskusiju
l doties uz pēdējo atbildi
ctrl+ enter iesniegt savu ziņojumu
(labā bultiņa) nākamajā lapā
(kreisā bultiņa) iepriekšējā lapa

Iestatījumi

Vēlies novērtēt šo vienumu vai pievienot to sarakstam?

Pieteikties