skwas.MockHttp.Json
3.0.1
.NET 5.0
.NET Standard 2.0
.NET Framework 4.6.2
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
Install-Package skwas.MockHttp.Json -Version 3.0.1
dotnet add package skwas.MockHttp.Json --version 3.0.1
<PackageReference Include="skwas.MockHttp.Json" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add skwas.MockHttp.Json --version 3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: skwas.MockHttp.Json, 3.0.1"
#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.Json as a Cake Addin
#addin nuget:?package=skwas.MockHttp.Json&version=3.0.1
// Install skwas.MockHttp.Json as a Cake Tool
#tool nuget:?package=skwas.MockHttp.Json&version=3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JSON extensions for MockHttp.
Documentation
Please see the wiki for documentation.
Usage example
MockHttpHandler mockHttp = new MockHttpHandler();
// Configure setup(s).
mockHttp
.When(matching => matching
.JsonContent(new { id = 123 })
.Method("GET")
.RequestUri("http://localhost/controller/*")
)
.RespondJson(HttpStatusCode.OK, new { id = 123, firstName = "John", lastName = "Doe" })
.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.6.2
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
- System.Text.Json (>= 5.0.0)
-
.NETFramework 4.7.2
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
- System.Text.Json (>= 5.0.0)
-
.NETFramework 4.8
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
- System.Text.Json (>= 5.0.0)
-
.NETStandard 2.0
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
- System.Text.Json (>= 5.0.0)
-
.NETStandard 2.1
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
- System.Text.Json (>= 5.0.0)
-
net5.0
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
-
net6.0
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- skwas.MockHttp (>= 3.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.1.0-rc0002 | 56 | 7/15/2022 |
3.1.0-rc0001 | 104 | 7/9/2022 |
3.0.1 | 9,431 | 1/15/2022 |
3.0.0 | 1,310 | 12/24/2021 |
3.0.0-rc0002 | 74 | 12/24/2021 |
3.0.0-rc0001 | 224 | 11/22/2021 |
2.4.0 | 7,225 | 2/19/2021 |
2.3.0 | 3,759 | 11/28/2020 |
2.2.1 | 7,367 | 1/17/2020 |
2.2.0 | 435 | 1/13/2020 |
2.1.0 | 313 | 1/11/2020 |
2.0.8 | 1,182 | 11/13/2019 |
2.0.4 | 343 | 9/6/2019 |
2.0.0 | 2,952 | 9/4/2019 |
2.0.0-rc-031 | 284 | 9/2/2019 |
2.0.0-rc-015 | 280 | 9/2/2019 |
2.0.0-rc-003 | 284 | 8/15/2019 |
2.0.0-rc-002 | 276 | 8/14/2019 |
v3.0.0
- Changed to System.Text.Json as default serializer, JSON.NET can be configured as default if desired (mockHttpHandler.UseNewtonsoftJson()).
- Added .NET 6.0 and .NET Framework 4.8/4.7.2/4.6.2 target framework support.
- Removed .NET Standard < 2 and .NET Framework 4.5 support.