FsHttp 9.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FsHttp --version 9.0.2
                    
NuGet\Install-Package FsHttp -Version 9.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FsHttp" Version="9.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FsHttp" Version="9.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FsHttp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FsHttp --version 9.0.2
                    
#r "nuget: FsHttp, 9.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=FsHttp&version=9.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FsHttp&version=9.0.2
                    
Install as a Cake Tool

FsHttp

FsHttp is a .Net HTTP client library for C# and 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

Documentation

Please see FsHttp Documentation site for a detailed documentation.

A Simple Example

An example in F#:

#r "nuget: FsHttp"

open FsHttp

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

An example in C#:

#r "nuget: FsHttp"

using FsHttp.CSharp;

await "https://reqres.in/api/users".Post()
    .CacheControl("no-cache")
    .Body()
    .Json(@"
        {
            ""name"": ""morpheus"",
            ""job"": ""leader""
        }
    ")
    .SendAsync();

Migrating to new versions

For different upgrade paths, please read the Migrations section in the docu.

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (16)

Showing the top 5 NuGet packages that depend on FsHttp:

Package Downloads
FsHttp.FSharpData

FSharp.Data (JSON) integration package for FsHttp

Functional.SplinterBots.API

Package Description

FsHttp.NewtonsoftJson

JSON.Net (Newtonsoft.Json) integration package for FsHttp

Swate.Api

Dotnet library for easy access to Swate API.

AVPRIndex

Type system and utils for the indexing backend of avpr.nfdi4plants.org

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
15.0.1 49,607 12/3/2024
14.5.2 420 12/3/2024
14.5.1 327,547 8/9/2024
14.5.0 175,356 3/5/2024
14.4.2 337 3/5/2024
14.4.1 73,220 2/5/2024
14.4.0 79,245 1/7/2024
14.2.0 863 1/5/2024
14.1.0 824 1/3/2024
14.0.0 663 1/2/2024
13.3.0 13,043 12/28/2023
13.2.0 646 12/28/2023
12.2.0-preview01 675 12/24/2023
12.1.0 3,507 11/27/2023
12.0.0 51,760 10/31/2023
11.0.0 55,837 8/5/2023
11.0.0-preview01 1,320 3/25/2023
10.0.0 200,776 11/25/2022
10.0.0-preview3 945 11/23/2022
10.0.0-preview2 1,154 11/12/2022
10.0.0-preview1 978 11/12/2022
9.1.2 34,598 6/5/2022
9.1.1 3,636 4/24/2022
9.1.0 1,789 4/19/2022
9.0.6 1,832 4/19/2022
9.0.5 1,834 4/14/2022
9.0.4 1,592 4/8/2022
9.0.3 1,472 4/8/2022
9.0.2 4,823 4/6/2022
9.0.1 1,400 4/5/2022
9.0.0 13,905 4/5/2022
8.0.1 8,481 3/6/2022
8.0.0 1,241 3/2/2022
7.0.0 44,496 12/13/2021
6.0.1 2,447 11/23/2021
6.0.0 1,088 11/22/2021
0.9.0 2,133 7/14/2019

v7.0.0
     - #92: `expect` and `assert` pass through the original response instead of unit.

     v8.0.0
     - #93 (thanks @drhumlen): Changed content type 'text/json' to 'application/json'.
     - Http modules are always AutoOpen in both Dsl and DslCE
     - No extra modules for builder methods

     v8.0.1
     - #89: No more blocking requests using net5 with FSI

     v9.0.0 / v9.0.1
     - Redefined builders (see README.md)
     - Many breaking changes (see "Migrations" sections in the docu)
     
     v9.0.2
     - Added JSON toArray functions
     - Fixed #99: Response.saveFile should create the directory if not present