fsprojects / FsHttp

A lightweight F# HTTP library by @SchlenkR and @dawedawe
https://fsprojects.github.io/FsHttp/
Apache License 2.0
424 stars 42 forks source link

ContentTypeForPart custom operations should come after part definition #129

Closed SchlenkR closed 11 months ago

SchlenkR commented 11 months ago

Current way for specifying a "ContentType" for given parts:

http {
    POST(url @"")
    multipart

    ContentTypeForPart explicitContentType1
    filePart "Resources/uploadFile.txt"

    ContentTypeForPart explicitContentType2
    filePart "Resources/uploadFile2.txt"
}
|> Request.send
|> Response.toText
|> should equal (explicitContentType1 + "," + explicitContentType2)

...should become:

http {
    POST(url @"")
    multipart

    filePart "Resources/uploadFile.txt"
    ContentType explicitContentType1

    filePart "Resources/uploadFile2.txt"
    ContentType explicitContentType2
}
|> Request.send
|> Response.toText
|> should equal (explicitContentType1 + "," + explicitContentType2)