Server Error in '/' Application.

Unexpected character encountered while parsing value: {. Path 'error', line 3, position 12.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'error', line 3, position 12.

Source Error:


Line 26:         HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Line 27:         var reader = new System.IO.StreamReader(response.GetResponseStream(), ASCIIEncoding.ASCII).ReadToEnd();
Line 28:         var typed = JsonConvert.DeserializeObject<Dictionary<string, string>>(reader);
Line 29:         var countryCode = typed["country_code"];
Line 30: 

Source File: d:\home\h204693.winp063.arubabusiness.it\nesea.net\Default.aspx.cs    Line: 28

Stack Trace:


[JsonReaderException: Unexpected character encountered while parsing value: {. Path 'error', line 3, position 12.]
   Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType) +996
   Newtonsoft.Json.JsonTextReader.ReadAsString() +10
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) +184
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id) +1307
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) +1036
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) +92
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) +488
   Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +210
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) +136
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, JsonSerializerSettings settings) +66
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value) +42
   Default2.geoip() in d:\home\h204693.winp063.arubabusiness.it\nesea.net\Default.aspx.cs:28
   Default2.Page_Load(Object sender, EventArgs e) in d:\home\h204693.winp063.arubabusiness.it\nesea.net\Default.aspx.cs:19
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0