R10-C INETS-4.2 HTTP post method

Ingela Anderton ingela@REDACTED
Mon Feb 14 13:10:50 CET 2005

Stephen Han wrote:
> Does anyone ever tried http:request with 'post' method?
> Since I install R10-C http client 'post' method is not working.
> There are bunch of message coming out but noteably at the beginning I
> got following message.
> > http:request(post, {"http://www.erlang.org", [], "application/xml", []}, [],[]).
> Of course, the sample URL is not valide but, I expect we should not
> get those error, either.
> ** dets: Bug was found when accessing table cookie_db,
> ** dets: operation was close and reply was
> ** {'EXIT',{{case_clause,{'EXIT',{{badmatch,{error,eacces}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}},[{dets,perform_save,2},{dets,fclose,1},{dets,apply_op,4},{dets,do_apply_op,4},{proc_lib,init_p,5}]}}.
This is due to misunderstanding because of different behaviors of
priv_dir in the test-server and in OTP. Alas in OTP priv_dir is not
always writable for the application. So we will have to find some
other solution for this. Proably we need to make it configurable.  In
the meantime a workaround would be change the path in http_cookie.erl,
you would need to change "code:priv_dir(inets)" against
some directory that is writable for you when you run erlang.

> ** exited: {{case_clause,{undefined,{error,
>                                         {'EXIT',
>                                             {{badmatch,
>                                                  {error,
>                                                      {badarg,
>                                                          [{erlang,
>                                                               '++',
>                                                               [0,"\r\n"]},
This is a bug. I will fix it.
In the file httpc_request.erl in the internal function post_data/3
the line

 ContentLength = length(Body),

should say:

 ContentLength = integer_to_list(length(Body)),

I will try to find some time to make a better test coverage for the
http-client, it was already on my list of things to do an apparently
you found an area where it was lacking.

/Ingela - OTP team

More information about the erlang-questions mailing list