{"id":25002648,"url":"https://github.com/skwasjer/mockhttp","last_synced_at":"2025-09-08T00:03:07.728Z","repository":{"id":39630459,"uuid":"195120957","full_name":"skwasjer/MockHttp","owner":"skwasjer","description":".NET library to mock HTTP responses for any HTTP client and verify request expectations with an experience inspired by Moq.","archived":false,"fork":false,"pushed_at":"2024-02-07T16:36:21.000Z","size":937,"stargazers_count":31,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-16T08:04:41.782Z","etag":null,"topics":["dotnet","dotnetcore","http","httpclient","httpmock","mock","mockhttp","mocking","testing","verifying-requests"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skwasjer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T20:16:52.000Z","updated_at":"2024-03-10T11:57:01.000Z","dependencies_parsed_at":"2023-02-09T15:46:40.509Z","dependency_job_id":"7e445534-fc3d-4469-a0bb-69d88857b819","html_url":"https://github.com/skwasjer/MockHttp","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skwasjer%2FMockHttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skwasjer%2FMockHttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skwasjer%2FMockHttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skwasjer%2FMockHttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skwasjer","download_url":"https://codeload.github.com/skwasjer/MockHttp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248563371,"owners_count":21125264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnetcore","http","httpclient","httpmock","mock","mockhttp","mocking","testing","verifying-requests"],"created_at":"2025-02-04T21:53:14.786Z","updated_at":"2025-04-12T11:41:36.946Z","avatar_url":"https://github.com/skwasjer.png","language":"C#","readme":"# MockHttp\n\nCollection of .NET libraries to mock HTTP responses for any HTTP client (`HttpClient`, `WebRequest`, `RestClient`, etc.)  and verify request expectations with an experience inspired by Moq.\n\n---\n\n[![Main workflow](https://github.com/skwasjer/MockHttp/actions/workflows/main.yml/badge.svg)](https://github.com/skwasjer/MockHttp/actions/workflows/main.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=skwasjer_MockHttp\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=skwasjer_MockHttp)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=skwasjer_MockHttp\u0026metric=coverage)](https://sonarcloud.io/component_measures?id=skwasjer_MockHttp\u0026metric=coverage)\n\n| | | |\n|---|---|---|\n| `skwas.MockHttp` | [![NuGet](https://img.shields.io/nuget/v/skwas.MockHttp.svg)](https://www.nuget.org/packages/skwas.MockHttp/) [![NuGet](https://img.shields.io/nuget/dt/skwas.MockHttp.svg)](https://www.nuget.org/packages/skwas.MockHttp/) | [Documentation](https://github.com/skwasjer/MockHttp/wiki) |\n| `skwas.MockHttp.Json` | [![NuGet](https://img.shields.io/nuget/v/skwas.MockHttp.Json.svg)](https://www.nuget.org/packages/skwas.MockHttp.Json/) [![NuGet](https://img.shields.io/nuget/dt/skwas.MockHttp.Json.svg)](https://www.nuget.org/packages/skwas.MockHttp.Json/) | [Documentation](https://github.com/skwasjer/MockHttp/wiki) |\n| `skwas.MockHttp.Server` | [![NuGet](https://img.shields.io/nuget/v/skwas.MockHttp.Server.svg)](https://www.nuget.org/packages/skwas.MockHttp.Server/) [![NuGet](https://img.shields.io/nuget/dt/skwas.MockHttp.Server.svg)](https://www.nuget.org/packages/skwas.MockHttp.Server/) | [Documentation](https://github.com/skwasjer/MockHttp/wiki/Stubbing-an-API) |\n\n## Documentation\n\nPlease see the [wiki for documentation](https://github.com/skwasjer/MockHttp/wiki).\n\n## Usage example ###\n\n```csharp\nMockHttpHandler mockHttp = new MockHttpHandler();\n\n// Configure setup(s).\nmockHttp\n    .When(matching =\u003e matching\n        .Method(\"GET\")\n        .RequestUri(\"http://localhost/controller/*\")\n    )\n    .Respond(with =\u003e with\n        .StatusCode(200)\n        .JsonBody(new { id = 123, firstName = \"John\", lastName = \"Doe\" })\n    )\n    .Verifiable();\n\nvar client = new HttpClient(mockHttp);\n\nvar response = await client.GetAsync(\"http://localhost/controller/action?test=1\");\n\n// Verify expectations.\nmockHttp.Verify();\n```\n\n### Contributions\n\nPlease check out the [contribution guidelines](./CONTRIBUTING.md).\n\n### Other info\n\n\u003e While this library was inspired by Moq - it does not and will not include [SponsorLink](https://github.com/moq/moq/issues/1372). I have no direct relation to Moq or its author.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskwasjer%2Fmockhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskwasjer%2Fmockhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskwasjer%2Fmockhttp/lists"}