http client

Ingela Anderton ingela@REDACTED
Wed Oct 27 14:44:13 CEST 2004


Johan Blom wrote:
> I have basically nothing to do with the OTP version of the HTTP client, 
> and I know they had to do some mangling to get it to work with the old 
> inets. So I guess I should have used a disclaimer as yours as I haven't 
> tried R10B at all! But at least it *used to* work in the way I describe.
> Reading the documentation in the links below it seems the interface has 
> changed quite a bit, thus I guess I should have kept silence.

Well yes the interface and the code is significantly changed, in the
documentation and release notes it says that the now supported http
client is loosly based on the previous unsupported version contributed
by Johan Blom.

The reasons for this are:

- The structure of the old client did not fit in to the OTP-concept
  with possibility for soft upgrade.

- We have a design principal that says that you should not make
  any assumptions on how the user will use the interface. So in
  the asynchronous case of the old interface it was assumed that the
  user would have implemented the process using the interface as
  a gen_server. Also it was assumed that it was "okej" to throw away
  some of the http status line information.

- The client and the http server in inets where fundamentally different
  and used different approaches to solve the same problem. We have now
  started to integrate them making some primitive modules that can be
  used by both the client and the server.

- The old client did not at all handle the case that the server may
  close the connection to indicate that it sent the whole response
  instead of sending a length header.

- The old client used a unsupported an undocumented feature to parse
  http-headers. (We are talking about maybe making it supported but
  there will still need a lot of new test-cases before that becomes a
  reality. In that case we will then make this way of parsing
  available in the client and http server). For now, I can say this way
  of doing it may be very fast but it does not always work!

> Matthias Lang wrote:
> > Johan Blom writes:
[...]
> > Hmm, there seems to be something very wrong with the documentation.
> > 
> > Take a look at
> > 
> >   http://www.erlang.se/doc/doc-5.4/lib/inets-4.0/doc/html/http.html
> > 
> > it doesn't mention request_sync/4 at all, and it says that request/4
> > is synchronous by default.
> > 
> > The examples in the inets user guide 
> > 
> >   http://www.erlang.se/doc/doc-5.4/lib/inets-4.0/doc/html/http_client.html
> > 
> > also seem wrong.
It is not wrong just different from how the old client worked. Note you can
still make an asynchronous request if you want to.

Of course there might still be bugs in the client, and it is an
ongoing work to write even more test and improve the client further.
The good part of the client now being officially supported is that
it is actually someones job to fix the bugs and you do not have
to rely on Johans spear time to be enough for everything.

I want however to say thank you to Johan for contributing your code
and even though we did not keep all of it as it was, maybe without it
there would not have been a http client in intes.

-- 
/Ingela

Ericsson AB - OTP team








More information about the erlang-questions mailing list