#1 2015-07-23 22:07:49

mmbk
Member
Registered: 2015-07-06
Posts: 9

timeout parameters don't work in THttpRequest

Hi, I'm trying this code:

  winHTTP := TWinHTTP.Create('localhost', '888', false, '', '', 60000, 70000, 130000);
  try
      Result := winHTTP.Post(StringToUTF8(link), StringToUTF8(data));
  finally
    winHTTP.Free;
  end;
but de post method return before my timeout, it always use the default constant

I think TWinHTTP.Create don't store any timeout parameters
The "winHTTP.Post" method call "THttpRequest.InternalREST" that call "self.Create(Server,Port,Https,'','')" using the default timeout parameters (const).

Can any one help me on this?

Thank you (sorry my english)

Offline

#2 2015-07-24 06:19:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,242
Website

Re: timeout parameters don't work in THttpRequest

Timeout parameters do work.
You are just making a confusion about method types.

Post() is a class function.
So it wont use the winHttp instance parameters, by definition. Just the class type.

Use the Request() method instead.

Offline

#3 2015-07-24 18:08:41

mmbk
Member
Registered: 2015-07-06
Posts: 9

Re: timeout parameters don't work in THttpRequest

Ok ab! Sorry about this!

Thank you for replay and congratulations on your framework!

Last edited by mmbk (2015-07-24 18:09:01)

Offline

Board footer

Powered by FluxBB