Error 502 (Bad Gateway) when sending a request with HttpWebRequest over SSL

前端 未结 5 686
误落风尘
误落风尘 2020-12-13 14:08

I have the following snippet in classic ASP, to send a command and retrieve the response over SSL:

Dim xmlHTTP
Set xmlHTTP = Server.CreateObject(\"Msxml2.Ser         


        
5条回答
  •  醉梦人生
    2020-12-13 14:50

    Read the entity body of the error response. It might have a hint as to what is happening.

    The code to do that is as follows:

    catch(WebException e)
    {
    if (e.Status == WebExceptionStatus.ProtocolError)
    {
        WebResponse resp = e.Response;
        using(StreamReader sr = new StreamReader(resp.GetResponseStream()))
        {
             Response.Write(sr.ReadToEnd());
        }
    }
    }
    

    That should show the full contents of the error response.

提交回复
热议问题