News for hackers. Stuff that matters.
Re:Nobody Understands REST or HTTP by davedx on Sunday February 26, 2012 @02:18PM (#3636470)
Can you elaborate on Unity not working well with headers? I've just started doing some web-stuff with it and found that so far it's been okay.
Re:Nobody Understands REST or HTTP by drawkbox on Sunday February 26, 2012 @03:02PM (#3636602)
Services are a bit painful in Unity due to the WWW class: http://unity3d.com/support/documentation/ScriptReference/WWW...

You can use System.Net.* but if you want support across iOS, Android, Web, and Desktop you need to use WWW. Which does not allow you to read or set headers.

I have decent services working with it in JSON using LitJson but it is something they should work on and has prevented me from using headers much in Unity. Even the WWWForm class is weak but there are hidden methods to set and read headers, just they don't work on all platforms yet.

My biggest hiccup in making true REST has actually been in games where web standards and tools are still pretty fresh. So many C/C++/C#/Python/Lua etc proprietary web libs that to make things work you have to have some fallback to uri based states or resources. I typically implement that as a fallback i.e. the version 1 api with headers or url route to the same place.

Re:Nobody Understands REST or HTTP by davedx on Monday February 27, 2012 @02:03AM (#3638065)
Ahh yeah, I noticed that things are different from platform to platform. Thankfully we mostly work with the web player rather than the mobile platforms, so it's been pretty painless so far. I'm really loving using coroutines with the web stuff, they fit nicely together.

Thanks for the info :)