Skip to content

Instantly share code, notes, and snippets.

@mthadley
Last active November 21, 2016 19:37
Show Gist options
  • Save mthadley/9e7a4d7041fd2b4a4b7070a1b6de850a to your computer and use it in GitHub Desktop.
Save mthadley/9e7a4d7041fd2b4a4b7070a1b6de850a to your computer and use it in GitHub Desktop.
Elm Url
import Http exposing (encodeUri)
url : String -> List ( String, String ) -> String
url base =
let
encodeParts ( key, value ) =
(encodeUri key) ++ "=" ++ (encodeUri value)
in
(++) base << (++) "?" << String.join "&" << List.map encodeParts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment