wwHTTP::OnHttpPostConnect
less than 1 minute to read

This event fires after the Http connection has been established and can be useful to set specific WinInet options on the HTTP connection.

Use this event to call SetOption() to apply HTTP connect options. Since SetOption() requires a connection handle, it can only be used in the context of a request, which means you have to subclass wwHttp and override the OnHttpPostConnect() method.

o.OnHttpPostConnect(lnHttpHandle)

Parameters

lnHttpHandle
The HTTP Handle created with the WinInet HttpOpenRequest() call. The Internet handle is also available in wwHttp::hHttpSession.

Remarks

Only fires on calls to HttpGetEx and HttpGet. Not supported on async calls.

Example

foxpro
loHttp = CREATEOBJECT("MywwHttp") loHttp.Get("...") DEFINE CLASS MywwHttp as wwHTTP FUNCTION OnHttpPostConnect() DECLARE INTEGER InternetSetOption ; IN WININET.DLL ; INTEGER HINTERNET,; INTEGER dwFlags,; INTEGER @dwValue,; INTEGER cbSize *** Make the Connection Timeout longer dwTimeoutSecs= 50 * 1000 && to milliseconds llRetVal=InternetSetOption(this.hHttpSession,; INTERNET_OPTION_CONNECT_TIMEOUT,; @dwTimeoutSecs,4) ENDFUNC ENDDEFINE

See also:

West Wind Web Connection

© West Wind Technologies, 1996-2024 • Updated: 08/28/20
Comment or report problem with topic