FsHttp is a HTTP client library written in F#. It aims for describing and executing HTTP requests in convenient ways that can be used in production and interactive environments.
FsHttp is authored by @ronaldschlenker. Feel free to leave a message.
NOTE: The NuGet package SchlenkR.FsHttp is deprecated. Please use the package FsHttp for releases >= 6.x
Please visit the FsHttp Documentation site.
You can also have a the Integration Tests that show various use cases.
#r "nuget: FsHttp"
open FsHttp
open FsHttp.DslCE
http {
POST "https://reqres.in/api/users"
CacheControl "no-cache"
body
json """
{
"name": "morpheus",
"job": "leader"
}
"""
}
You need to have the latest .Net 5 SDK installed.
There is a F# script that can be used to perform several build tasks from command line. It can be executed in this way:
dotnet fsi .\build.fsx [task]
Common tasks are:
- build
- test
- docu
- publish
The Readme.md
and the content in ./docs
is auto-generated from the files in ./src/Docu
. In order to build them, run the command dotnet fsi .\build.fsx docu
.
Parts of the code is taken from the HTTP utilities of FSharp.Data.