I need to send a GET request to Facebook from unity3d and retrieve it’s answer (JSON object). I do it well in Visual Studio with WebRequest. But as far as I know, WebRequest class is not supported in iOS. So I’m trying to accomplish this with Unity’s standart WWW class. Doing as follows:
public static IEnumerator GETRequestToFacebook()
{
WWW www = new WWW("https://graph.facebook.com/fql?q=select name from profile where id=707855857");
yield return www;
Debug.Log(www.text);
}
But that method gives me the following error: “You are trying to load data from a www stream which had the following error when downloading. 400 Bad Request”. But if I change url to “http://www.google.com” it works just fine.
What should I do to make my initial GET request work in unity3d?
Thanks!
Solved. I should have put ‘+’ signs in a FQL request.
https://graph.facebook.com/fql?q=select+name+from+profile+where+id=707855857“
Nevermind, I’ve already written a web socket.