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:
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
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.
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.
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
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.
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.
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.