- Home /
convert Java code that can retrieve the url content to unity javascript
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet("https://desksms.appspot.com/api/v1/user/your_email@gmail.com/sms");
String ascidCookie = settings.getString("Cookie");
get.setHeader("Cookie", ascidCookie);
get.setHeader("X-Same-Domain", "1"); // XSRF
HttpResponse response = client.execute(get);
Thanks in advance. What I wanna know is how can I convert these codes so that they can be executed in Unity. The other method I want to know is that can I yield a web content through specific browser (Ex: Chrome or Safari) That means I can retrive the content without setting cookies. Hope there's someone who can help me, thank a lot!!!!
I've searched almost every website, actually this code contains authentication of username and password, they're all stored in the browser cookie.
In fact I do know I can easily yield a page content using the code I wrote below
var www:WWW = new WWW(urlString);
yield www;
var result: String=www.text;
Debug.Log(result);
But there seems no way to login with google account. Thanks anyway.
is open - zillions of answers on here about cookies, search on cookies
here's an advanced related question I asked !
http://answers.unity3d.com/questions/443240/using-www-to-simply-post-a-slab-of-text-ala-json.html
Your answer
