Error in http client

Ingela Anderton ingela@REDACTED
Wed May 25 14:56:08 CEST 2005

Corrado Santoro wrote:
> Hi all,
> I'm using the http client module of inets to realise an http proxy. When 
>   I invoke "http:request" I often receive the result:
> {error,session_remotly_closed}
> It seems that the remote site has closed the connection, but the strange 
> thing is that I receive such a reply when I issue a request to Google.
Which version of inets are you using?


http:request(get, {"", []}, [], []).


http:request(get, {"", []}, [], []).

works fine for me on the latest version, that is inets-4.4.1. However I do
not think this version made it to open source yet!

> Could someone explain the exact meaning of such a message.
It means that the socket was closed by the server and that this was
not expected. In some situations the server will close the
socket to indicate that that all data has been sent instead of using
a length header or chunked-encoding. (In that situation you will not
get an error, as then, it is expected that the socket can be closed.)

Google sends a length header:

7>  http:request(get, {"", []}, [], []).
      {"date","Wed, 25 May 2005 12:32:01 GMT"},
       "PREF=ID=4ab7f9cf7a993 ....

/Ingela - OTP team

More information about the erlang-questions mailing list