[erlang-questions] Creation of HTTP URLs with arguments

Torben Hoffmann <>
Tue Oct 11 11:39:48 CEST 2011


On Mon, Oct 10, 2011 at 19:16, Steve Vinoski <> wrote:

> On Mon, Oct 10, 2011 at 11:48 AM, Torben Hoffmann
> <> wrote:
> > Hi,
> > I want to create URLs that looks like this:
> > http://my.coolest.site.com?arg1=val1,arg2=val2
>
> The usual standard format is
>
> http://my.coolest.site.com?arg1=val1&arg2=val2
>
> Any reason you want a comma instead of an ampersand there?
>

Typo...


>
> > Are there any libraries out there that makes this kind of creation easy?
> I
> > have tried playing with ibrowse, but that was not a success (might be me
> at
> > fault more than ibrowse ;-))
> > I am dreaming of something that takes a proplist ([{Key, Value}]) and
> does
> > all the magic for me, but I am open to other approaches as long as my
> life
> > becomes easier than fiddling with strings.
> > Otherwise, I will just create my own library for this, but it seems like
> a
> > thing that others have might have had to do before.
>
> In yaws there's yaws_api:format_url which takes a url record and can
> produce the above (with the ampersand rather than the comma).
>
> https://github.com/klacke/yaws/blob/master/src/yaws_api.erl#L1349


I will have a look!

Thanks for the pointer

Cheers,
Torben

>
>
> --steve
>



-- 
http://www.linkedin.com/in/torbenhoffmann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111011/488141dd/attachment.html>


More information about the erlang-questions mailing list