Post Arguments
Dale Harvey
harveyd@REDACTED
Mon Sep 12 17:22:37 CEST 2005
Hey
Im having small problems formulating post arguements in http:request to
match the format sent by browsers,
allowed types are binary, and string, I outputted Arg after sending a post
request from a form with 2 fields, number and string
the post part of the argument was in binary, so io:formatting binary_to_term
came out [{"number","numberval"},{"string","stringval"}]
this is also what yaws_api:parse_post() gave me
which is pretty much what i expected, but if i send,
PostArg = term_to_binary([{"number","numberval"},{"string","stringval"}])
http:request(post,{Url,[],"text/plain",PostArg},[],[]),
I need to use
[{MessageTemp,_}] = yaws_api:parse_post(Arg),
Message = binary_to_term(list_to_binary(MessageTemp)).
to get the post arguments in [{Key,Val}] format (please dont ask how / why i
came up with that)
So is there any way to manually formulate post arguements to match the
format they are sent by a browser,
as I havent found anything to help me do so
Thanks
Dale
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050912/b6e85f00/attachment.htm>
More information about the erlang-questions
mailing list