How to send KeepAlive header correctly in c#?

后端 未结 2 2030

I need to send a request like this using HttpWebRequest:

POST https://sap.site.com.mx/sap/bw/BEx?SAP-LANGUAGE=ES&PAGENO=1&CMD=PROCESS_VARIABLES&REQUE         


        
2条回答
  •  半阙折子戏
    2021-02-10 08:12

    I had the same bug with the very similar code, and setting

    var sp = req.ServicePoint;
    var prop = sp.GetType().GetProperty("HttpBehaviour", BindingFlags.Instance | BindingFlags.NonPublic);
    prop.SetValue(sp, (byte)0, null);
    

    DID fix it. Are you sure that you do execute this code each time you create httpwebrequest?

提交回复
热议问题