Hello folks.
I have seen a lot of posts about WebRequest not working with the webplayer, but I am having trouble getting it to run in the standalone.
It runs fine in the editor, but throws a NotSupportedException when I try to create a new web request object using something like: HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
As I already stated, works perfectly fine in the editor, just not in the stand alone build.
Oh, and WWW or WWWForm will not work, already looked into those options.
Running Unity 3.3 on Mac.
Any thoughts?
Thanks for your help.
did you target the full .net 2.0 instead of only the subset?
Yep, otherwise it would never compile.
I just checked the relevant documentation (http://docs.go-mono.com/System.Net.HttpWebRequest) and as far as I see the creation of the object might be meant to be done differently in Mono
As for WWW: If or if not they are an option naturally depends on your project but you might none the less want to design something that works with them, for your own and long term stability sake, as there is no guarantee that system.web will work in the future. Aside of that your solution would, even if it worked, only work on standalone which is a serious problem in portability and reusability of your solution
The Mono documentation on instantiating an HttpWebRequest (or a WebRequest) is no different from what I have. In the first post of this thread, my code snippet is what is used to instantiate a WebRequest and then cast it as a HttpWebRequest, where the “url” argument is a Uri object.
Just puzzling why it would work perfectly fine in the editor but not in the stand alone, or at least puzzling to somebody like me who does not know anything about Unity’s backend.
Also, probably would design and develop to use WWW, but it lacks some functionality that is needed. From what I have seen in documentation, WWW and WWWForm only support PUT and GET protocol methods. Need more than that unfortunately.