C# client response Error 502: Bad Gateway - how to resolve?

Asked

Viewed 365 times

1

 using (var httpClient = new HttpClient())
            {
                var request = new HttpRequestMessage();
                string pathApi = "https://uatdoorway.derbysoftsec.com/xml/hoteldescriptiveinfo/username/";

                string xml = @"<HotelDescriptiveInfoRequest Token='Jan' UserName='username' Password='Password'>
                                <HotelDescriptiveInfos Language='' >                                         
                                        <HotelDescriptiveInfo HotelCode='HY-VISTA'/>
                                </HotelDescriptiveInfos>
                                </HotelDescriptiveInfoRequest>";

                var content = new StringContent(xml, Encoding.UTF8, "text/xml");
                httpClient.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse("xptohemlmi");

                var response = httpClient.PostAsync(pathApi, content).Result;

                if (response.IsSuccessStatusCode)
                {
                    var result = response.Content.ReadAsStringAsync().Result;
                }
            }
  • 2

    Your pathApi is not available, is the service not offline? How much do I try to access https://uatdoorway.derbysoftsec.com/ gives the error 404 page not found

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.