Any reason why HttpWebRequest would work in editor but not in standalone?

I have been using HttpWebRequest. It runs great in the editor, but the standalone throws a NotSupportedException when I instantiate the HttpWebRequest.

Somehow it seems to either not be allowed to using WebRequest or the standalone is not being packaged with all of its dependencies.

Any thoughts?

I have tried to write my own socket connection for this, but am having a rough go of it.

Two things you could try:

1: Check: Edit > Project Settings > Player
and try changing the API optimisation from .NET (Subset) to just .NET

2: Check out Unity’s WWW class as an alternative: http://unity3d.com/support/documentation/ScriptReference/WWW.html

  1. Had to change the project settings before it would compile in the editor.
  2. Already looked into WWW and WWWForm classes, but they do not seem to provide a way to do PUT and DELETE protocol methods, so cannot use them.

Needless to say, I have already tried a great number of work arounds.

Still, it just seems odd that something would work in the editor and not in the standalone. There has to be a reason, but nothing from the user-side of things seems to explain this.

I am completely stuck because WWW class does not support PUT/DELETE http verbs. Our multiplayer game can no longer be done because we are using Azure Queue Storage as a way to deliver a message to the client (Unity Web Player in a browser). Without DELETE verb, the message can never be removed from the queue.

I’d urge anyone who needs this to vote on the wishlist item here, thanks :slight_smile:

http://feedback.unity3d.com/unity/all-categories/1/hot/active/more-rest-api-friendly-www-class