|
I've been using the example code in the unity documents to send and get high score data from a php file on a server. I use the header to store the authorization key to access that file and it works a charm. Now I tried the same thing for a different php file for the login server and it doesn't work. The authorization key is correct because I've tested it in a browser and it returns some information but in-game the server just times out waiting for a POST request. The server admin claims that there have been no access attempts logged so it must be stumbling right after accepting the authorization key, if I remove the secret key then the server returns straight away with an unauthorized access message. Has anyone else had this problem? Is there another way to POST or GET on a server with or without using the unity WWW class. I've tried using unity 3 and have changed www.data to www.text but it still doesn't work. Is there any new functions on the latest WWW class? This is for iPhone if it makes any difference. Code:
(comments are locked)
|
|
UnityWeb might help you. It now supports HTTPS, and can do custom GET POST HEADERS the works. :-) Yup, looks very interesting. Will try that too.
May 22 '11 at 11:26 PM
BerggreenDK
(comments are locked)
|
This is something I'm using atm, works a treat. Of course there's also a lot of additional checking etc in headings for security etc. The security bit is the important part, the above code works for every site except this one as it has an odd login requirement. I used the same code for a different website with a login and it worked. I'm half certain it's to do with the server side but I'm curious if there's alternative client methods.
Sep 07 '10 at 10:15 PM
spinaljack
(comments are locked)
|
|
Saw this on another answers page. You can't modify a WWWForm's headers directly, you have to create your own: (C#)
(comments are locked)
|

Just curious if you got this to work? Also have you tried it on PC/OSX and the results were?