[erlang-questions] Erlang HTTP client is not so fault tollerant...
Ingela Anderton Andin
ingela@REDACTED
Tue Dec 11 11:05:37 CET 2007
> > Therefore, I'd like to replace the first line of the incoming server
> > response from "HTTP/1.1 301\r\n" to "HTTP/1.1 301 Moved
> > Permanently\r\n", but I can't seem to find where the appropriate to do
> > so would be...
> >
>
> Personably I've found the HTTP client in OTP unusable and I'd
> never put it in a production environment unless the set of URLs to
> GET was finite and all GETs were tested.
Once upon a time I would have agreed with you, but things change
and I think that unusable is an unfair assessment.
The above is not valid HTTP and yes there are some standard
deviations that you alas want to support as a client, we have
got the relaxed mode for this and the above will be a candidate for that.
> It hangs on bad input instead of returning an error last
> time I tried it.
And when was last time you tried it? To take for instance this
particular case it did not hang it returned and error. There was also
a process implemented as a gen_server and part of a supervision tree that
died due to the error and hence this was reported in the shell. But there
was no harm done due to this, it is expected that this process shall terminate,
and that is exactly why I think it would be a good idea to use try-catch here so
that this process can be terminated normally, so that we do not get a supervision
report that people can misunderstand.
> ibrowse in jungerl works much better. I don't think there are any
> easy ways to get to ibrowse short of checking out the jungerl
> tree and ripping it out though.
Now this is comparing apples to pears. Sure they are both HTTP-clients but the
they have really different approaches. ibrowes is really basic leaving
very much up to the user. A minimalistic approach, at least last time I checked, which
I admit was some time ago. The inets client has the concept of sessions and profiles,
more cookie support, automatically retries pipelines when a previous request fails, supports ipv6,
streams result to a file or a process with active-once flow control, supports soft code upgrade etc.
Now please I do not want to start a war, I am sure there are users that will find ibrowse is just
what fits there needs and other that will think the inets client is just what they want. I think the
best is to try for yourself and make up your own mind with consideration for your own needs.
Could we please just leave it at that.
Reagards Ingela - OTP team
More information about the erlang-questions
mailing list