[Gambas-user] HttpClient

Daniel Campos dcamposf at ...626...
Sun Jun 17 16:19:46 CEST 2007


> > I'm wondering how to use HttpClient. I've written a function:
> >
> > PUBLIC SUB blah()

HttpClient is asynchronous by default, so trying to read from the
buffer after doing Get() has no sense (HTTP communications can delay
some seconds in WAN). So, you have two options:

1) Wait for the Read event to get pieces of information as they arrive
to the local system.

2) Put the "Async" property set to FALSE prior to Get(), that way
Get() will stop the program flow until all the information is
received. In that case you should use also the "TimeOut" property to
set a timeout, if not, it could hang forvever if the server does not
reply properly.

Daniel




More information about the User mailing list