/fsprojects--FsHttp

A lightweight F# HTTP library by @ronaldschlenker

Primary LanguageF#Apache License 2.0Apache-2.0

FsHttp

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.

NuGet Badge build status

NOTE: The NuGet package SchlenkR.FsHttp is deprecated. Please use the package FsHttp for releases >= 6.x

Documentation

Please visit the FsHttp Documentation site.

You can also have a the Integration Tests that show various use cases.

A Simple Example

#r "nuget: FsHttp"

open FsHttp
open FsHttp.DslCE

http {
    POST "https://reqres.in/api/users"
    CacheControl "no-cache"
    body
    json """
    {
        "name": "morpheus",
        "job": "leader"
    }
    """
}

Building

You need to have the latest .Net 5 SDK installed.

Building binaries, publish, and test

There is a F# script that can be used to perform several build tasks from command line. It can be executed in this way:

PS> dotnet fsi .\build.fsx [task]

Common tasks are:

  • build
  • test
  • publish

Building the documentation

The documentation in ./docs is auto-generated from the files in ./src/Docu. In order to build them, run:

PS> .\docu.ps1

Credits

Parts of the code is taken from the HTTP utilities of FSharp.Data.