Please help me in fixing the problem..why it is not working?
internal static int AddCatalog(string name, Guid key, string userName)
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:25169/ScopraAdminRESTService.svc/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var paramInput = new CustomData() { name=name, key = key, userName = userName };
StringContent content = new StringContent(paramInput.ToString(), Encoding.UTF8);
HttpResponseMessage response = client.PutAsync("xml/updatecatalog", content).Result;
if (response.IsSuccessStatusCode)
{
return 1;
}
else
{
return -1;
}
}