I am using WinHttp object to send and receive information (getting a document in terms of bytes and opening on the browser by converting it into PDF). I am not setting any timeout explicitly in my C# program. Sometimes, our clients are coming across 'timeout' error while downloading the document ('Send' operation). Default timeout for send operation is 30 seconds and this is timing out much before that.
My c# code:
-------------
using WinHttp;
string strXmlDoc = "1234"; //unique key to get the document
string url = " WinHttpRequest objHttp = new WinHttpRequest();
objHttp.Open("POST",URL,false);
objHttp.Send(strXmlDoc); ----> Here it is timingout
byte[] results = (byte[]) objHttp.ResponseBody;
I am getting the following error:
---------------------------------
Description: The operation timed out
Source: download document: WinHttp.WinHttpRequest
Stack Trace: at WinHttp.WinHttpRequestClass.Send(Object Body)
What could be the problem?
My c# code:
-------------
using WinHttp;
string strXmlDoc = "1234"; //unique key to get the document
string url = " WinHttpRequest objHttp = new WinHttpRequest();
objHttp.Open("POST",URL,false);
objHttp.Send(strXmlDoc); ----> Here it is timingout
byte[] results = (byte[]) objHttp.ResponseBody;
I am getting the following error:
---------------------------------
Description: The operation timed out
Source: download document: WinHttp.WinHttpRequest
Stack Trace: at WinHttp.WinHttpRequestClass.Send(Object Body)
What could be the problem?