Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

HoloLens REST client based on HttpWebRequest

edited February 2017 in Questions And Answers

Hi developers,

what REST clients are you using at the moment in your HoloLens application(s)?

I am wondering if some of you are experiencing the same problems with a REST client on HoloLens. I'm having problems with the different .NET version in Unity (3.5) and on HoloLens (4.5), because the HttpWebRequest class is different in each framework.

In .NET 3.5 (Unity3D):

var rs = httpWebRequest.GetRequestStream();
using(var streamWriter = new StreamWriter(rs))
{ }

but get compile errors when deploying to HoloLens because on .NET 4.5 it's:

var rs = httpWebRequest.GetRequestStream**Async**().Result;
using(var streamWriter = new StreamWriter(rs))
{ }

So every time I build the Unity project I must implement GetRequestStream() and then change it to GetRequestStreamAsync() before deploying it to the HoloLens.

Any ideas how to fix this? Or am I doing something stupid?




Sign In or Register to comment.