api-builder
api-builder copied to clipboard
Parse Route from String/URL
It would be nice if one could convert something like
http://api.stackexchange.com/2.2/questions?order=asc&min=1413849600&sort=creation&tagged=frp&site=stackoverflow&filter=*1FDl3RYdSl
into a Route
without having to manually parse the URL elements into something like:
questionsRoute = Route { urlPieces = [ "2.2", "questions" ]
, urlParams = [ "order" =. ("desc" :: Text)
, "sort" =. ("creation" :: Text)
, "site" =. ("stackoverflow" :: Text)
, ... ]
, httpMethod = "GET" }