# Authenticated GET request

**URL:** https://discussions.unity.com/t/authenticated-get-request/418065
**Category:** Scripting
**Tags:** Scripting
**Created:** [July 13, 2010, 8:58pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065 "2010-07-13T20:58:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![anon\_35963613](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@anon\_35963613](https://discussions.unity.com/u/anon_35963613)
#### Post date: [July 13, 2010, 8:58pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/1 "2010-07-13T20:58:53Z")

</div>

Has anyone tried using the www class with the google doc list API? I’m half way there and looking for help. Using www and wwwform, I was able to put together a POST request that authenticated and downloads an authorization token. But you need to send that token back in the header of all subsequent requests.

From the doc list docs:

> [@](#):
>
> After a successful authentication request, use the Auth value to create an Authorization header for each request:  
> Authorization: GoogleLogin auth=yourAuthValue

I’ve got my AuthValue but can’t figure out using WWW how to make an “authenticated GET request”. I’ve tried as a form, filling in the header, but there are no fields to the request and so unity throws a wobbly. Can anyone with a deeper understanding of get and post requests lend a hand?

Thanks

---

<div class="post-metadata">

### Author: ![goodhustle](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/goodhustle/32/280488_2.png) [@goodhustle](https://discussions.unity.com/u/goodhustle)
#### Post date: [July 13, 2010, 10:13pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/2 "2010-07-13T22:13:07Z")

</div>

The Goog is expecting you to be able to add stuff into the HTTP Request header, which it looks like the WWW class isn’t built for. WWWForm looks like it’s made for that, but it appears to be POST only. You might be out of luck. System.Web may be the way to go, so i’d advise you to search the forums for info on how to add in a DLL to your build that would include that library.

---

<div class="post-metadata">

### Author: ![anon\_35963613](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@anon\_35963613](https://discussions.unity.com/u/anon_35963613)
#### Post date: [July 14, 2010, 3:57pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/3 "2010-07-14T15:57:42Z")

</div>

That’s what I suspected. Thanks.

I’ve tried using Google’s .NET APIs, so I don’t have to send the commands with GET and POST, but their .Net libraries apparently use namespaces, so I Unity yells at me when I try to use them in my Unity project.

As for System.Web…I’m working on an iPhone app, so I’m not sure that System.Web even works. I’ll check it out.

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 14, 2010, 4:02pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/4 "2010-07-14T16:02:12Z")

</div>

check if they have an iphone API and hook that up if so. otherwise write it in objc through NSURLConnection for example and hook it up.

That being said, on the iphone WWW is much more advanced than on the other platforms (it uses above mentioned class).

And if their libraries use namespaces thats no problem, just don’t forget to put “using xxx.yyyy;” at the top

---

<div class="post-metadata">

### Author: ![anon\_35963613](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@anon\_35963613](https://discussions.unity.com/u/anon_35963613)
#### Post date: [July 14, 2010, 6:59pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/5 "2010-07-14T18:59:50Z")

</div>

Yeah. I put in the using statements, but when I run the script through Unity it says it can’t access certain types in the Google dlls. I’d read another message in the forum that said Unity threw that error because of namespaces. I’ve got the .dlls in my assets folder, so it must be another problem. Thanks all.

---

<div class="post-metadata">

### Author: ![Dreamora](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/dreamora/32/91058_2.png) [@Dreamora](https://discussions.unity.com/u/Dreamora)
#### Post date: [July 14, 2010, 7:15pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/6 "2010-07-14T19:15:28Z")

</div>

potentially it just relies on framework not present in .NET 1.1 (-\> set target to 2.1 to be sure) or not present in the used mono version at all (or not usable with AOT)

but yeah should it rely on the webrequest namespace internally it stands little to no chance to work commonly.

---

<div class="post-metadata">

### Author: ![anon\_35963613](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@anon\_35963613](https://discussions.unity.com/u/anon_35963613)
#### Post date: [July 15, 2010, 3:29pm UTC](https://discussions.unity.com/t/authenticated-get-request/418065/7 "2010-07-15T15:29:56Z")

</div>

With the 3.0 beta, I got it to build with the Google .dlls but, it throws an exception about 12 levels deep when I actually run it on the phone. I’m going to say that using the Google .Net APIs is a never ran on the iPhone. I’ll try it with NSUrl.
