Skip to content

Instantly share code, notes, and snippets.

@sheepla
Created March 24, 2024 06:24
Show Gist options
  • Save sheepla/45029de5b99ad2b3f39711e77806d594 to your computer and use it in GitHub Desktop.
Save sheepla/45029de5b99ad2b3f39711e77806d594 to your computer and use it in GitHub Desktop.
BuildURL.fs
let url =
let builder = new UriBuilder("https://www.example.com")
// let values = HttpUtility.ParseQueryString(builder.Query)
builder.Query <-
set [("key1", "value1"); ("key2", "value2")]
|> Set.map (fun (k, v) -> sprintf "%s=%s" <| Uri.EscapeDataString(k) <| Uri.EscapeDataString(v))
|> String.concat "&"
builder.ToString()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment