Network Subsystem is down in Xamarin
-
This is my code, i am using XAMARIN FORM. I can conect to the API using GET, the API is running, but when i try to do a POST to call the postTransacciones, i got the following error: NetWork Subsystem is down.
var data = new[]
{
new KeyValuePair("fechaGasto", Fecha),
new KeyValuePair("tipogasto", TipoGastoData),
new KeyValuePair("RNC", txtRNCSuplidor.ToString()),
new KeyValuePair("NCF",txNCF.ToString()),
new KeyValuePair("URL", sUrl),
new KeyValuePair("Monto",txtMonto.ToString()),
new KeyValuePair("TipoTransaccion",TipoTransaccion),
new KeyValuePair("email", EmailUser),
};#if DEBUG
HttpClientHandler insecureHandler = DependencyService.Get().GetInsecureHandler();
HttpClient client = new HttpClient(insecureHandler);
#else
HttpClient client = new HttpClient();
#endifstring url = "https://localhost:7254/api/GetData/postTransacciones"; var json =JsonConvert.SerializeObject(data); client.BaseAddress = new Uri(url); var stringContent = new StringContent(json, Encoding.UTF8,"application/json"); try { HttpResponseMessage response = await client.PostAsync(url, stringContent);
Thanks in advanced.
-
This is my code, i am using XAMARIN FORM. I can conect to the API using GET, the API is running, but when i try to do a POST to call the postTransacciones, i got the following error: NetWork Subsystem is down.
var data = new[]
{
new KeyValuePair("fechaGasto", Fecha),
new KeyValuePair("tipogasto", TipoGastoData),
new KeyValuePair("RNC", txtRNCSuplidor.ToString()),
new KeyValuePair("NCF",txNCF.ToString()),
new KeyValuePair("URL", sUrl),
new KeyValuePair("Monto",txtMonto.ToString()),
new KeyValuePair("TipoTransaccion",TipoTransaccion),
new KeyValuePair("email", EmailUser),
};#if DEBUG
HttpClientHandler insecureHandler = DependencyService.Get().GetInsecureHandler();
HttpClient client = new HttpClient(insecureHandler);
#else
HttpClient client = new HttpClient();
#endifstring url = "https://localhost:7254/api/GetData/postTransacciones"; var json =JsonConvert.SerializeObject(data); client.BaseAddress = new Uri(url); var stringContent = new StringContent(json, Encoding.UTF8,"application/json"); try { HttpResponseMessage response = await client.PostAsync(url, stringContent);
Thanks in advanced.
Sort of like: "the power is off".
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
This is my code, i am using XAMARIN FORM. I can conect to the API using GET, the API is running, but when i try to do a POST to call the postTransacciones, i got the following error: NetWork Subsystem is down.
var data = new[]
{
new KeyValuePair("fechaGasto", Fecha),
new KeyValuePair("tipogasto", TipoGastoData),
new KeyValuePair("RNC", txtRNCSuplidor.ToString()),
new KeyValuePair("NCF",txNCF.ToString()),
new KeyValuePair("URL", sUrl),
new KeyValuePair("Monto",txtMonto.ToString()),
new KeyValuePair("TipoTransaccion",TipoTransaccion),
new KeyValuePair("email", EmailUser),
};#if DEBUG
HttpClientHandler insecureHandler = DependencyService.Get().GetInsecureHandler();
HttpClient client = new HttpClient(insecureHandler);
#else
HttpClient client = new HttpClient();
#endifstring url = "https://localhost:7254/api/GetData/postTransacciones"; var json =JsonConvert.SerializeObject(data); client.BaseAddress = new Uri(url); var stringContent = new StringContent(json, Encoding.UTF8,"application/json"); try { HttpResponseMessage response = await client.PostAsync(url, stringContent);
Thanks in advanced.
Wrong forum. Read the message at the top and click the link that says "Got a programming question?".
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
This is my code, i am using XAMARIN FORM. I can conect to the API using GET, the API is running, but when i try to do a POST to call the postTransacciones, i got the following error: NetWork Subsystem is down.
var data = new[]
{
new KeyValuePair("fechaGasto", Fecha),
new KeyValuePair("tipogasto", TipoGastoData),
new KeyValuePair("RNC", txtRNCSuplidor.ToString()),
new KeyValuePair("NCF",txNCF.ToString()),
new KeyValuePair("URL", sUrl),
new KeyValuePair("Monto",txtMonto.ToString()),
new KeyValuePair("TipoTransaccion",TipoTransaccion),
new KeyValuePair("email", EmailUser),
};#if DEBUG
HttpClientHandler insecureHandler = DependencyService.Get().GetInsecureHandler();
HttpClient client = new HttpClient(insecureHandler);
#else
HttpClient client = new HttpClient();
#endifstring url = "https://localhost:7254/api/GetData/postTransacciones"; var json =JsonConvert.SerializeObject(data); client.BaseAddress = new Uri(url); var stringContent = new StringContent(json, Encoding.UTF8,"application/json"); try { HttpResponseMessage response = await client.PostAsync(url, stringContent);
Thanks in advanced.