skwas.MockHttp 3.0.0-rc0002

.NET 5.0 .NET Standard 2.0 .NET Framework 4.8
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-rc0002
dotnet add package skwas.MockHttp --version 3.0.0-rc0002
<PackageReference Include="skwas.MockHttp" Version="3.0.0-rc0002" />
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-rc0002
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: skwas.MockHttp, 3.0.0-rc0002"
#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-rc0002&prerelease

// Install skwas.MockHttp as a Cake Tool
#tool nuget:?package=skwas.MockHttp&version=3.0.0-rc0002&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.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

  • .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 5,144 1/15/2022
3.0.0 863 12/24/2021
3.0.0-rc0002 51 12/24/2021
3.0.0-rc0001 215 11/22/2021
2.4.0 9,508 2/19/2021
2.3.0 3,892 11/28/2020
2.2.1 8,138 1/17/2020
2.2.0 508 1/13/2020
2.1.0 335 1/11/2020
2.0.8 1,185 11/13/2019
2.0.4 336 9/6/2019
2.0.0 3,030 9/4/2019
1.3.0 311 7/27/2019
1.2.0 349 7/7/2019
1.1.2 308 7/4/2019
1.1.0 307 7/4/2019
1.0.0 326 7/3/2019

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