WWW class is empty on iOS (44974)

I have some networking code using Unity’s WWW class that reads data from a remote server. It works fine in the editor, but when I try it from an iPad the www object is completely empty - no headers, no error, nothing. Here’s a stripped down version of what I’m doing:

WWW www;

public void StartLogin (string username, string password)
{	
	WWWForm form = new WWWForm();
	form.AddField("username", username);
	
	Hashtable headers = form.headers;
	
	headers["username"] = username;
	headers["password"] = password;
	headers["deviceId"] = 2; 
	
	www = new WWW(loginUrl, form.data, headers);
	//StartCoroutine(WaitForLoginRequest());		
}

void Update()
{
	if (www != null && www.isDone)
	{
		DoLoginRequest();
	}
}

void DoLoginRequest()
{
		//Code goes here

		www = null;
}

As you can see, I started using coroutines, but switched over to a simpler version using Update (didn’t help). I know the connection is getting through to the server because it’s logging an error 412 - I can fix that, but I’m more worried about where all my information is going on the iOS side.

Update - I realised that the response text was supposed to be empty. So the big question becomes "do response headers work on iOS"?

–

1 Answer

1

And the answer is no, response headers seem to be completely broken on iOS. If anyone else hits this problem, I suggest not using them.

Sir did you got solution? plz help. i am also get stuck in it...

–