i'm new in web services, i have created a web service that works fine using postman, i can make requests and see the response, however if i use the same url with the same verb in an application, i get the following error: error 10061 connection refused
the code that makes the call for the service is:
var httpWebRequest = (HttpWebRequest)WebRequest.Create(strUrl);
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{\"user\":\"test\"," +
"\"password\":\"bla\"}";
streamWriter.Write(json);
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}
what´s missing?
Update: this is an image with the succesfull response in postman Get Verb with json body
Post Verb with json body, just as is in code
What would be the problem?
Thank's in advance
SOLVED, i've found solution here: Xamarin: Connect to locally hosted web service