A lightweight F# HTTP library by @SchlenkR and @dawedawe
FsHttp ("Full Stack HTTP") is a "hackable HTTP client" that offers a legible style for the basics while still affording full access to the underlying HTTP representations for covering unusual cases. It's the best of both worlds: Convenience and Flexibility.
.http
files, VSCode's REST client, Postman, and other tools as an interactive and programmable playground for HTTP requests.๐ Postman? โค๏ธ FsHttp! https://youtu.be/F508wQu7ET0
Developed and maintained by @SchlenkR and @dawedawe. Feel free to leave us a message.
#r "nuget: FsHttp"
open FsHttp
http {
POST "https://reqres.in/api/users"
CacheControl "no-cache"
body
jsonSerialize
{|
name = "morpheus"
job = "leader"
|}
}
|> Request.send
#r "nuget: FsHttp"
using FsHttp;
await Http
.Post("https://reqres.in/api/users")
.CacheControl("no-cache")
.Body()
.JsonSerialize(new
{
name = "morpheus",
job = "leader"
}
)
.SendAsync();
.Net SDK:
You need to have a recent .NET SDK installed, which is specified in ./global.json
.
Build Tasks
There is a F# build script (./build.fsx
) that can be used to perform several build tasks from command line.
For common tasks, there are powershell files located in the repo root:
./test.ps1
: Runs all tests (sources in ./src/Tests
).
./test.ps1 --filter Name~'Response Decompression'
./docu.ps1
: Rebuilds the FsHttp documentation site (sources in ./src/docs
)../docu-watch.ps1
: Run it if you are working on the documentation sources, and want to see the result in a browser../publish.ps1
: Publishes all packages (FsHttp and it's integration packages for Newtonsoft and FSharp.Data) to NuGet.
./src/Directory.Build.props
and keep the file up-to-date.