Facebook app getting "Warning: fopen......." - Please help!
Posted
by Poni
on Stack Overflow
See other posts from Stack Overflow
or by Poni
Published on 2010-04-29T18:02:27Z
Indexed on
2010/04/29
18:07 UTC
Read the original article
Hit count: 405
Hello!
I'm trying to establish a Facebook application. I'm getting the following PHP notice randomly:
Warning: fopen(http://api.facebook.com/restserver.php? … &v=1.0) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in D:\projects........\facebookapi_php5_restlib.php on line 3391
As said, it happens randomly.
My app configuration: IFrame
Page host configuration: Windows Vista, Apache 2.2.11, PHP 5.1
No support for cURL is possible at the moment.
My aim:
Get the user's first name & pic_square along with two other preferences. If these two preferences are not set then I'll set them, after doing some internal job.
I understand that the REST API is old. Which interface should I use then?
Saw FQL, which seem to be fine, but I see no corresponding getUserPreference/setUserPreference interface.
Where is it? How do I combine it with the "first name & pic_square" info that I need in one query? How do I read the results of multi-query query?
Also, if I understand correctly, the FQL is also executed with the fopen() function, and as we see here it might fail.
That means something went wrong, and then I want to handle it. Any suggestions how to do so efficiently? Less important than the above question though.
Thank you all.
© Stack Overflow or respective owner