Fox.UriExt

Source

Summary

encode_query(params)

just like URI.encode_query/1, except it also encodes embedded lists and maps

fmt(uri, tuple)

Takes a template string and fills it in with stuff in the tuple

Functions

encode_query(params)

just like URI.encode_query/1, except it also encodes embedded lists and maps

Examples

query = [

dog: "rover", 
cats: ["mrmittens", "fluffmeister"], 
mascots: %{ember: "hamster", go: "gopher"}

] query |> encode_query # dog=rover&cats[]=mrmittens&cats[]=fluffmeister&mascots[ember]=hamster&mascots[go]=gopher

Source
fmt(uri, tuple)

Takes a template string and fills it in with stuff in the tuple

Examples

“customers/:custmer_id/cards/:id” |> fmt({“cus_666”, “car_616”}) # customers/cus_666/cards/car_616

Source