Calling one api http://10.xxx.xxx.xx:xx/web/services/xxxxx with json list as a parameter, It working from local machine (c# program and postman also).
using (var client = new HttpClient())
{
try
{
var jsonpar = JsonConvert.SerializeObject(new
{
param= objorders
});
var url = config.weburl;
var stringContent1 = new StringContent(jsonpar , Encoding.UTF8, "application/json");
var apiResponse1 = client.PostAsync('http://10.xxxxx/web/xxxx', stringContent1 )
if(apiResponse1 .result.issuucesscode)
{
}
But when deploying same code to task scheduler in server, getting below response.
Error:ServiceUnavailableStatusCode: 503, Reason Phrase: 'Service Unavailable', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Pragma: no-cache Proxy-Connection: Keep-Alive Connection: Keep-Alive Cache-Control: no-cache Content-Length: 859 Content-Type: text/html; charset=utf-8 }