WebClient JavaScript Error

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
Posts: 6
Joined: Thu Dec 10, 2015 8:38 am

WebClient JavaScript Error

Postby boonec6 » Mon Oct 31, 2016 6:37 am

I'm trying to make a WebClient call, but I'm receiving an error when testing it in the browser or on a device.

Code: Select all

Unhandled exception at line 0:
Script error.
More details can be found in the JavaScript Console output.

My block of code is:

Code: Select all

        public string getParent(string creds)
            string json1 = "{\"jsonrpc\":\"2.0\",\"method\":\"findLeads\",\"params\":{\"query\":{\"number\":" +
            NSLeadBox.Text +
                        //7218 +
            var webClient = new WebClient();
            webClient.Headers[HttpRequestHeader.Accept] = "application/json";
            webClient.Headers.Add("Authorization", "Basic " + creds);
            string response = webClient.UploadString("https://app01.nutshell.com/api/v1/json/", json1);

            return response;

The program runs as expected in the simulator. Any ideas on where I'm going wrong?

Return to “Technical Support”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests