Skip to content

Commit b1bd152

Browse files
committed
Delete verb now supports body #167
1 parent 2747097 commit b1bd152

File tree

8 files changed

+42
-20
lines changed

8 files changed

+42
-20
lines changed

HttpFs.IntegrationTests/AssemblyInfo.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ open System.Reflection
44

55
[<assembly: AssemblyTitleAttribute("HttpFs.IntegrationTests")>]
66
[<assembly: AssemblyProductAttribute("HttpFs.IntegrationTests")>]
7-
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
7+
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
9+
[<assembly: AssemblyVersionAttribute("5.4.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs.IntegrationTests"
1515
let [<Literal>] AssemblyProduct = "HttpFs.IntegrationTests"
16-
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
16+
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.3.0"
19-
let [<Literal>] AssemblyFileVersion = "5.3.0"
18+
let [<Literal>] AssemblyVersion = "5.4.0"
19+
let [<Literal>] AssemblyFileVersion = "5.4.0"

HttpFs.IntegrationTests/HttpServer.fs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ let app =
177177

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

180-
Filters.DELETE >=> Filters.path "/Delete" >=> Successful.OK ""
180+
Filters.DELETE >=> choose [
181+
Filters.path "/Delete" >=> Successful.OK ""
182+
Filters.path "/DeleteWithBody" >=> request (fun r ->
183+
recordedRequest <- Some r
184+
Successful.OK "")
185+
]
181186

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

HttpFs.IntegrationTests/Tests.fs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,17 @@ let tests =
463463
Expect.equal resp.statusCode 200 "statusCode should be equal"
464464
}
465465

466+
testCaseAsync "Delete method with body works" <| async {
467+
let! resp =
468+
Request.create Delete (uriFor "/DeleteWithBody")
469+
|> Request.bodyString "Hi mum"
470+
|> getResponse
471+
|> Alt.toAsync
472+
473+
let req = HttpServer.recordedRequest in
474+
Expect.equal (req.Value |> getHeader "content-length") "6" "content-length should be equal"
475+
}
476+
466477
testCaseAsync "Other method works" <| async {
467478
use! resp =
468479
Request.create (HttpMethod.Other "OTHER") (uriFor "/Other")

HttpFs.UnitTests/AssemblyInfo.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ open System.Reflection
44

55
[<assembly: AssemblyTitleAttribute("HttpFs.UnitTests")>]
66
[<assembly: AssemblyProductAttribute("HttpFs.UnitTests")>]
7-
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
7+
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
9+
[<assembly: AssemblyVersionAttribute("5.4.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs.UnitTests"
1515
let [<Literal>] AssemblyProduct = "HttpFs.UnitTests"
16-
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
16+
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.3.0"
19-
let [<Literal>] AssemblyFileVersion = "5.3.0"
18+
let [<Literal>] AssemblyVersion = "5.4.0"
19+
let [<Literal>] AssemblyFileVersion = "5.4.0"

HttpFs/AssemblyInfo.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ open System.Reflection
44

55
[<assembly: AssemblyTitleAttribute("HttpFs")>]
66
[<assembly: AssemblyProductAttribute("HttpFs")>]
7-
[<assembly: AssemblyCopyrightAttribute("Copyright © 2019")>]
7+
[<assembly: AssemblyCopyrightAttribute("Copyright © 2020")>]
88
[<assembly: AssemblyDescriptionAttribute("A simple, functional HTTP client library for F#")>]
9-
[<assembly: AssemblyVersionAttribute("5.3.0")>]
10-
[<assembly: AssemblyFileVersionAttribute("5.3.0")>]
9+
[<assembly: AssemblyVersionAttribute("5.4.0")>]
10+
[<assembly: AssemblyFileVersionAttribute("5.4.0")>]
1111
do ()
1212

1313
module internal AssemblyVersionInformation =
1414
let [<Literal>] AssemblyTitle = "HttpFs"
1515
let [<Literal>] AssemblyProduct = "HttpFs"
16-
let [<Literal>] AssemblyCopyright = "Copyright © 2019"
16+
let [<Literal>] AssemblyCopyright = "Copyright © 2020"
1717
let [<Literal>] AssemblyDescription = "A simple, functional HTTP client library for F#"
18-
let [<Literal>] AssemblyVersion = "5.3.0"
19-
let [<Literal>] AssemblyFileVersion = "5.3.0"
18+
let [<Literal>] AssemblyVersion = "5.4.0"
19+
let [<Literal>] AssemblyFileVersion = "5.4.0"

HttpFs/HttpFs.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ module Client =
767767
| HttpMethod.Post
768768
| HttpMethod.Put
769769
| HttpMethod.Patch
770+
| HttpMethod.Delete
770771
| HttpMethod.Other _ -> true
771772
| _ -> false
772773

HttpFs/HttpFs.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>HttpFs</AssemblyName>
55
<PackageId>Http.fs</PackageId>
6-
<Version>5.3.0</Version>
6+
<Version>5.4.0</Version>
77
<TargetFrameworks>netstandard2.0;net471</TargetFrameworks>
88
</PropertyGroup>
99
<ItemGroup>

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 5.4.0 — 2018-06-27
2+
* Delete verb now supports body
3+
* Support for custom http method
4+
* ContentEncoding request header
5+
16
#### 5.3.0 — 2018-06-27
27
* Default non-specified charsets to UTF8 rather than Latin 1.
38

0 commit comments

Comments
 (0)