Post Arguments
Dale Harvey
harveyd@REDACTED
Tue Sep 20 21:49:35 CEST 2005
Sorry to bring up an unaswered thread, but I started playing about with the
again, and getting some progress, but i still cant find how to replicate the
post information sent by the browser using http:request, it seems pretty
close but without being able to find any documentation I cant see what im
doing wrong,
http:request(post,{Url,[],"application/x-www-form-urlencoded","key1=var1&key2=var2"},[],[]).
http:request(post,{Url,[],"application/x-www-form-urlencoded",<<"key1=var1&key2=var2">>},[],[]).
are both throwing the same error
Reason:
{{badmatch,[{"key1","val1"},{"key2","val2"}]},[mymodule,out,1},{yaws_server,deliver_dyn_part,8
....
(mymodule:out/1 is just io:formatting arg for now)
I assume its getting close as [{"key1","val1"},{"key2","val2"}] is the
format the post args come out when i parse_post data sent from an actual
post form.
Ive scraped through the inets - http source code, without finding much
clues, and nothing on previous newletter / internet searches.
also tried formatting the binary data sent when using an actual form
[{"key1","val1"},{"key2","val2"}] being sent prints out ->
<<107,101,121,49,61,118,97,108,49,38,107,101,121,50,61,118,97,108,50>> as
the post body
but this wont binary_to_term, I also tried reverse engineering parse post,
but having a hard time understanding it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050920/a47c7e37/attachment.htm>
More information about the erlang-questions
mailing list