F fabio borges Member Licensed User Longtime User Aug 29, 2013 #1 Hi everybody, I'm having a problem with httpclient setheader. When I set the post header "Content-Length" I get a null response error from the server. If I dont set vUrl = "http://sigensvc.cidasc.sc.gov.br/AtualizacaoSaldoAnimais/Incluir" HTTPReq.InitializePost2(vUrl,vPost.GetBytes("UTF8")) HTTPReq.SetHeader("Content-Length","631") HTTPReq.SetHeader("Cookie", "SessionID="&vSessionID&"; UserAuth="&vUserAuth) HTTPReq.SetHeader("Connection","keep-alive") HTTPReq.SetContentType("application/xml") HTTPReq.Timeout = 100000 HTTPCli.Execute(HTTPReq,2)
Hi everybody, I'm having a problem with httpclient setheader. When I set the post header "Content-Length" I get a null response error from the server. If I dont set vUrl = "http://sigensvc.cidasc.sc.gov.br/AtualizacaoSaldoAnimais/Incluir" HTTPReq.InitializePost2(vUrl,vPost.GetBytes("UTF8")) HTTPReq.SetHeader("Content-Length","631") HTTPReq.SetHeader("Cookie", "SessionID="&vSessionID&"; UserAuth="&vUserAuth) HTTPReq.SetHeader("Connection","keep-alive") HTTPReq.SetContentType("application/xml") HTTPReq.Timeout = 100000 HTTPCli.Execute(HTTPReq,2)
Erel B4X founder Staff member Licensed User Longtime User Aug 29, 2013 #2 I recommend you to use HttpUtils2 instead. The content length header is added automatically based on the array length. Upvote 0
I recommend you to use HttpUtils2 instead. The content length header is added automatically based on the array length.