Skip to content

Commit

Permalink
Delete verb now supports body #167
Browse files Browse the repository at this point in the history
  • Loading branch information
ivpadim committed Feb 8, 2020
1 parent 2747097 commit b1bd152
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 20 deletions.
12 changes: 6 additions & 6 deletions HttpFs.IntegrationTests/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("HttpFs.IntegrationTests")>]
[<assembly: AssemblyProductAttribute("HttpFs.IntegrationTests")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
[<assembly: AssemblyVersionAttribute("5.3.0")>]
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
[<assembly: AssemblyVersionAttribute("5.4.0")>]
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "HttpFs.IntegrationTests"
let [<Literal>] AssemblyProduct = "HttpFs.IntegrationTests"
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
let [<Literal>] AssemblyVersion = "5.3.0"
let [<Literal>] AssemblyFileVersion = "5.3.0"
let [<Literal>] AssemblyVersion = "5.4.0"
let [<Literal>] AssemblyFileVersion = "5.4.0"
7 changes: 6 additions & 1 deletion HttpFs.IntegrationTests/HttpServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ let app =

Filters.OPTIONS >=> Filters.path "/Options" >=> Successful.OK ""

Filters.DELETE >=> Filters.path "/Delete" >=> Successful.OK ""
Filters.DELETE >=> choose [
Filters.path "/Delete" >=> Successful.OK ""
Filters.path "/DeleteWithBody" >=> request (fun r ->
recordedRequest <- Some r
Successful.OK "")
]

Filters.PUT >=> Filters.path "/Put" >=> Successful.OK ""

Expand Down
11 changes: 11 additions & 0 deletions HttpFs.IntegrationTests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,17 @@ let tests =
Expect.equal resp.statusCode 200 "statusCode should be equal"
}

testCaseAsync "Delete method with body works" <| async {
let! resp =
Request.create Delete (uriFor "/DeleteWithBody")
|> Request.bodyString "Hi mum"
|> getResponse
|> Alt.toAsync

let req = HttpServer.recordedRequest in
Expect.equal (req.Value |> getHeader "content-length") "6" "content-length should be equal"
}

testCaseAsync "Other method works" <| async {
use! resp =
Request.create (HttpMethod.Other "OTHER") (uriFor "/Other")
Expand Down
12 changes: 6 additions & 6 deletions HttpFs.UnitTests/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("HttpFs.UnitTests")>]
[<assembly: AssemblyProductAttribute("HttpFs.UnitTests")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
[<assembly: AssemblyVersionAttribute("5.3.0")>]
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
[<assembly: AssemblyVersionAttribute("5.4.0")>]
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "HttpFs.UnitTests"
let [<Literal>] AssemblyProduct = "HttpFs.UnitTests"
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
let [<Literal>] AssemblyVersion = "5.3.0"
let [<Literal>] AssemblyFileVersion = "5.3.0"
let [<Literal>] AssemblyVersion = "5.4.0"
let [<Literal>] AssemblyFileVersion = "5.4.0"
12 changes: 6 additions & 6 deletions HttpFs/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ open System.Reflection

[<assembly: AssemblyTitleAttribute("HttpFs")>]
[<assembly: AssemblyProductAttribute("HttpFs")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
[<assembly: AssemblyVersionAttribute("5.3.0")>]
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
[<assembly: AssemblyVersionAttribute("5.4.0")>]
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "HttpFs"
let [<Literal>] AssemblyProduct = "HttpFs"
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
let [<Literal>] AssemblyVersion = "5.3.0"
let [<Literal>] AssemblyFileVersion = "5.3.0"
let [<Literal>] AssemblyVersion = "5.4.0"
let [<Literal>] AssemblyFileVersion = "5.4.0"
1 change: 1 addition & 0 deletions HttpFs/HttpFs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ module Client =
| HttpMethod.Post
| HttpMethod.Put
| HttpMethod.Patch
| HttpMethod.Delete
| HttpMethod.Other _ -> true
| _ -> false

Expand Down
2 changes: 1 addition & 1 deletion HttpFs/HttpFs.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>HttpFs</AssemblyName>
<PackageId>Http.fs</PackageId>
<Version>5.3.0</Version>
<Version>5.4.0</Version>
<TargetFrameworks>netstandard2.0;net471</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#### 5.4.0 — 2018-06-27
* Delete verb now supports body
* Support for custom http method
* ContentEncoding request header

#### 5.3.0 — 2018-06-27
* Default non-specified charsets to UTF8 rather than Latin 1.

Expand Down

0 comments on commit b1bd152

Please sign in to comment.