skwas.MockHttp 3.0.0-rc0001

This is a prerelease version of skwas.MockHttp.
There is a newer version of this package available.
See the version list below for details.
Install-Package skwas.MockHttp -Version 3.0.0-rc0001
dotnet add package skwas.MockHttp --version 3.0.0-rc0001
<PackageReference Include="skwas.MockHttp" Version="3.0.0-rc0001" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add skwas.MockHttp --version 3.0.0-rc0001
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: skwas.MockHttp, 3.0.0-rc0001"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install skwas.MockHttp as a Cake Addin
#addin nuget:?package=skwas.MockHttp&version=3.0.0-rc0001&prerelease

// Install skwas.MockHttp as a Cake Tool
#tool nuget:?package=skwas.MockHttp&version=3.0.0-rc0001&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

.NET library to mock HTTP responses for HttpClient and verify request expectations with an experience inspired by Moq.

Documentation

Please see the wiki for documentation.

Usage example

MockHttpHandler mockHttp = new MockHttpHandler();

// Configure setup(s).
mockHttp
    .When(matching => matching
        .Method("GET")
        .RequestUri("http://localhost/controller/*")
    )
    .Respond(HttpStatusCode.OK)
    .Verifiable();

var client = new HttpClient(mockHttp);

var response = await client.GetAsync("http://localhost/controller/action?test=1");

// Verify the expectations.
mockHttp.Verify();

Contributions

Please check out the contribution guidelines.

  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on skwas.MockHttp:

Package Downloads
skwas.MockHttp.Json

JSON and MediaTypeFormatter extensions for skwas.MockHttp.

skwas.MockHttp.Server

.NET library to mock HTTP responses for any HTTP client and verify request expectations with an experience inspired by Moq.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.1 113 1/15/2022
3.0.0 280 12/24/2021
3.0.0-rc0002 27 12/24/2021
3.0.0-rc0001 186 11/22/2021
2.4.0 6,825 2/19/2021
2.3.0 3,864 11/28/2020
2.2.1 8,122 1/17/2020
2.2.0 477 1/13/2020
2.1.0 310 1/11/2020
2.0.8 1,160 11/13/2019
2.0.4 310 9/6/2019
2.0.0 3,003 9/4/2019
1.3.0 283 7/27/2019
1.2.0 322 7/7/2019
1.1.2 280 7/4/2019
1.1.0 281 7/4/2019
1.0.0 298 7/3/2019

v3.0.0
     - Added .NET 6 target framework
     - Removed .NET Standard < 2 and .NET Framework