- Home /
www not working on android and iOS
0 down vote favorite I'm trying to access a server that my friend made using php. I'm using a WWW object to GET or POST json. The server always requires http basic authorization. For example, one of my GET requests to get a user's info looks like this.
https://basicauthuser:basicauthpass@x.y.com/user/samantha/
In the unity editor (v5.4.0f4), it works great! No problem. On iOS, I get a "Not Found" response (it doesn't say 404, just "Not Found"), and on Android I get a "401: Unauthorized" response.
On iOS, I've made sure that arbitrary http loads are enabled in xcode when building, but this is an HTTPS address, so it shouldn't matter. I've also tried accessing the server with an HTTP address, and I don't get any difference in response for either device.
With the WWW object, I'm sending the following headers, in case it helps:
headers.Add ("Content-Length", _jsonDataToSend.Length.ToString());
headers.Add ("Content-Type", "application/json");
headers.Add ("Accepts", "application/json");
Why are my calls failing on iOS and android? Halp plz! Thanks.