Skip to content

Instantly share code, notes, and snippets.

@MelbourneDeveloper

MelbourneDeveloper/Url.fs

Last active May 30, 2021
Embed
What would you like to do?
F# Url
[<TestMethod>]
member this.TestComposition () =
let uri =
"host.com".ToHttpUrlFromHost(5000)
.AddQueryParameter("fieldname1", "field<>Value1")
.WithCredentials("username", "password")
.AddQueryParameter("FieldName2", "field<>Value2")
.WithFragment("frag")
.WithPath("pathpart1", "pathpart2")
Assert.AreEqual("http://username:password@host.com:5000/pathpart1/pathpart2?fieldname1=field%3C%3EValue1&FieldName2=field%3C%3EValue2#frag",uri.ToString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment