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.

HTTP Client with Unity

Has anyone gotten an HTTP Client to talk to Restful APIs functional on the HoloLens? It seems like there is a huge discrepancy between what will run in the standalone player and what will run when you target UWP. I've tried UnityHTTP, Web API 2.0, and RestSharp, but none of these will allow rebuilding of the project in unity since there are some namespaces missing (.Net frameworks are different).

Maybe I'm misunderstanding here because I feel like this is a super simple task that should be available, but share your success (or failures).


Best Answer


  • @HoloSheep This makes a helluva ton of sense now. I guess this will just require some getting used to when testing the scene within Unity. Thank you so much!

  • One of the many benefits of testing Holographic apps in either the HoloLens Emulator or on a real device.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • edited October 2016

    @HoloSheep said:
    @animodoc Unity uses mono which is .NET 3.5. When it builds the UWP project, that project is .NET 4.5 or greater.

    That generated UWP project is where you would add the required UWP .Net references.

    When using .NET apis in your solution that require the UWP versions of .NET, you should try and isolate the logic into appropriate procedures or even their own files and you can use "#If" statements around sections or the touch points so that they do not cause errors in the Unity editor environment.

    If you do a search for "#if" in a generated project that includes the HoloToolkit you will find a number of sections of code that are wrapped in:


    are there any other #if statements? when i surround my using directive with your suggestion, the error disappears in unity editor but as soon as i want to rebuild the unity project, the error reappears and the build fails.

  • @TR_HILSCHER the Unity docs has a page with a bunch of the precompilation directives mentioned here and another one (possibly older) here.

    The particular sample condition and properties can be found in use in a loto of the Microsoft scripts if you search your build UWP project from Unity.

    In many cases, simply testing for !UNITY_EDITOR should get you past the Unity IDE build errors.

    What error are you getting? and is it appearing in Visual Studio or in Unity?
    What Using statement are you making conditional?
    Did you include the required Reference for that namespace in your UWP project?

    Note that you can also use the #if directive with your own Build variables, it is a C# construct.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • Seems like you got your answer so this is probably not needed but I'm a fan of Best HTTP Pro. $60 so don't mess with it if Unity's code is working for you. But if you hit a wall or find something missing on UWP (sockets, etc), this has been great: https://www.assetstore.unity3d.com/en/#!/content/10872


  • I found this http://www.claytoninds.com/#httpclient
    You can get it from the Asset Store for free and it works as expected.

Sign In or Register to comment.