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.
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
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?
Thanks!
Tagged:
1
Answers
Just found the Platform Dependent Compilation directives.
But are there any other solutions?
And does anyone know when Unity upgrades to .NET 4.6? Just read about the 5.5.0* beta release with .NET 4.6 but sadly just Editor-Mode version.
Why not use WWW?:
IEnumerator GetTax()
{
WWW www = new WWW(url);
yield return www;
if (www.error == null)
{
HandleJSon(www.text);
}
else
{
Debug.Log("ERROR: " + www.error);
}
}
@OptiLenso
Can you please publish your full solution?
I'm struggling with the same problem...
Thanks, lukas
Did you guys try UnityWebRequest class? https://docs.unity3d.com/Manual/UnityWebRequest.html
https://www.billmccrary.com/