System.NotSupportedException when fetch is called

Hi all,

I’m having some trouble getting fetch to work. When I call fetch, I get a System.NotSupportedException. I’ve done some research and it’s possible I might be doing something wrong, because I’ve used fetch before in my fuse apps.

My Fuse version is 0.12.2 build 6298 running on Mac OS X El Capitan

My code is below.

<App Theme="Basic">
        'use strict'

        function ResultsData(data) {
            this.kit_code = data.kits.kit_code
            this.location = data.kits.registered_at
            let regDate =" ")
            this.registration_date = ${regDate[0]} at ${regDate[1]}
        / MOCK /
        let MOCK_RESULT = {
                "registered_at":"United Kingdom",
                "registered_on":{"date":"2011-07-20 15:23:54","timezone_type":3,"timezone":"UTC"}
        / MOCK /
        var Observable = require("FuseJS/Observable")
        let API_ENDPOINT = ";
        let URLS = {
            search: ${API_ENDPOINT}/search
        let showResults = Observable(false)
        let isLoading = Observable(false)
        let searchTerm = Observable("resource")
        let results = Observable({})
        let showOverlay = Observable(false)
        let closeOverlay = () => {
            showOverlay.value = false
            showResults.value = false
            isLoading.value = false
        let fetchResults = () => {
            showOverlay.value = true
            isLoading.value = true

            / MOCK REQUESTS /
            // setTimeout(function () {
            //     if (!!showOverlay.value) {
            //         isLoading.value = false
            //         results.value = new ResultsData(MOCK_RESULT)
            //         showResults.value = true
            //     }
            // }, 2000)
            / END MOCK /
            console.log( + "?q=" +searchTerm.value)
            fetch( + "?q=" + searchTerm.value) 
                .then((response) => {
                    return response.json()
                .then((jsonResponse) => {
                    console.log('response: '+ JSON.stringify(jsonResponse))
                    isLoading.value = false
                    results = jsonResponse
                }).catch((e) => {
                    // isLoading.value = false
        module.exports = {
        <Text ux:Class="KitPropertyLabel" FontSize="14" TextColor="#999" />
        <Text ux:Class="KitPropertyDetail" FontSize="13" TextColor="#555" />
        <Circle Height="20" Width="20"  Color="#fff" ux:Class="CloseButton" Alignment="TopRight" Clicked="{closeOverlay}">
            <Text Alignment="Center" FontSize="15" Value="×" />
        <Text ux:Class="ResultStatus" TextAlignment="Center" Padding="0,10" TextColor="#11dd11" FontSize="20" />
        <Android.StatusBarConfig IsVisible="false" IsNavigationBarVisible="true" Color="#f89829" />
        <BottomBarBackground Dock="Bottom"/>
        <CloseButton Offset="-15, 35" Layer="Overlay" Opacity="0" ux:Name="closeOverlayButton"/>
        <StackPanel Alignment="Center" Height="0" Width="0" Layer="Overlay" Color="#00000066" ux:Name="overlay">
                    <Resize X="1" Y="1" RelativeTo="LayoutChange" Duration="0.2" Easing="CubicInOut"/>
                    <Move X="1" Y="1" RelativeTo="LayoutChange" Duration="0.2" Easing="CubicInOut"/>
                <WhileTrue Value="{isLoading}">
                    <Rectangle Fill="#fff" Alignment="Center" Height="80" Width="120" CornerRadius="5">
                            <Move Y="1" RelativeTo="ParentSize" Duration="0.2"/>
                        <Text Alignment="BottomCenter" Padding="0,5" FontSize="12" TextColor="#f89829" Value="Searching..."/>
                        <DropShadow Color="#0002" Angle="90" Size="10" Spread="0.1" Distance="4"/>
                <WhileTrue Value="{showResults}">
                    <StackPanel Padding="10" Color="#fff" Width="85%" >
                            <Move Y="1" RelativeTo="ParentSize" Duration="0.2"/>
                        <DropShadow Color="#0002" Angle="90" Size="10" Spread="0.1" Distance="4"/>
                            <ResultStatus  Value="Kit found"/>
                        <Grid Padding="5" ColumnCount="2" Columns="2, 3">
                            <KitPropertyLabel Value="Kit" />
                            <KitPropertyDetail Value="{results.kit_code}"/>
                        <Rectangle Height="2px" Color="#ddd"/>
                        <Grid Padding="5" ColumnCount="2" Columns="2, 3">
                            <KitPropertyLabel Value="Registered in" />
                            <KitPropertyDetail Value="{results.location}" />
                        <Rectangle Height="2px" Color="#ddd"/>
                        <Grid Padding="5" ColumnCount="2" Columns="2, 3">
                            <KitPropertyLabel Value="Registration Date" />
                            <KitPropertyDetail Value="{results.registration_date}" />
        <Panel Dock="Fill">
            <!-- <Panel Alignment="Center" Height="0" Width="0" ux:Name="overlayHidden">
            <Panel Alignment="Center" Height="100%" Width="100%" HitTestMode="None" ux:Name="overlayVisible"> -->
            <!-- </Panel> -->
            <!-- <FileImageSource ux:Key="logo" File="./pictures/logo.png" /> -->
            <WhileTrue Value="{showOverlay}">
                <Set overlay.Height="100%" />
                <Set overlay.Width="100%" />
                <Change closeOverlayButton.Opacity="1" Duration="0.5" />
            <WhileFalse Value="{showOverlay}">
                <Set overlay.Width="0%" />
                <Set overlay.Height="0%" />
                <Change closeOverlayButton.Opacity="0"  Duration="0"/>
            <Page ux:Class="SlidePage">
                    <Move X="1" RelativeTo="ParentSize" />
                    <Move X="-1" RelativeTo="ParentSize" />

            <SlidePage ux:Name="searchPage">
                <StackPanel Alignment="Center">
                <Image  Margin="0,0,0,50" Width="250" File="pictures/logo.png" />
                    <TextInput Value="{searchTerm}" PlaceholderText="Enter Kit Code" PlaceholderColor="#898989" />
                    <Rectangle  Width="200" Padding="10"  Background="#f89829">
                            <Move Y="1" />
                        <Text Alignment="Center" Value="Search" FontSize="18" TextColor="#fff"/>
                            <Callback Handler="{fetchResults}"/>
                            <!-- <NavigateTo Target="resultsPage" /> -->

            <SlidePage ux:Name="resultsPage" ux:AutoBind="false">
                    <Text>Welcome to page 1!</Text>
                    <Button Text="Go Back">
                            <GoBack />

The error I get is below

LOG: System.NotSupportedException:
      at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0 
      at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0 
      at System.Net.WebRequest.Create (System.String requestUriString) [0x00000] in <filename unknown>:0 
      at MyHttpLib.HttpRequest..ctor (System.String url) [0x00000] in <filename unknown>:0 
      at Uno.Net.Http.Implementation.CilHttpRequest..ctor (IHttpMessageHandlerRequestCallbacks requestCallbacks, System.String method, System.String url) [0x00000] in <filename unknown>:0 
      at Uno.Net.Http.Implementation.CilHttpRequest.Create (IHttpMessageHandlerRequestCallbacks requestCallbacks, System.String method, System.String url) [0x00000] in <filename unknown>:0 
      at Uno.Net.Http.HttpMessageHandlerRequest..ctor (Uno.Net.Http.HttpMessageHandler handler, System.String method, System.String url, IDispatcher dispatcher) [0x00000] in <filename unknown>:0 
      at Uno.Net.Http.HttpMessageHandler.CreateRequest (System.String method, System.String url, IDispatcher dispatcher) [0x00000] in <filename unknown>:0 
      at Fuse.Reactive.FuseJS.Http+FuseJSHttpClient.CreateRequest (System.Object[] args) [0x00000] in <filename unknown>:0 
      at Fuse.Scripting.V8.Marshaller+CallbackWrapper.Call (Fuse.Scripting.V8.Simple.UniqueValueVector args) [0x00000] in <filename unknown>:0

I’m sure I’m doing something wrong, but can’t see it (yet). I can provide more information if need be.

Kind regards,


Got it fixed by updating to v0.12.3