mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 16:58:27 +02:00
Updated Admin API Reference (markdown)
@@ -7,6 +7,19 @@ var server = FluentMockServer.StartWithAdminInterface();
|
|||||||
# API definition
|
# API definition
|
||||||
A Swagger 2.0 definition can be found [on swagger hub](https://app.swaggerhub.com/apis/StefHeyenrath/WireMock/1.0.13.0).
|
A Swagger 2.0 definition can be found [on swagger hub](https://app.swaggerhub.com/apis/StefHeyenrath/WireMock/1.0.13.0).
|
||||||
|
|
||||||
|
# Client API
|
||||||
|
You can use a predefined interface API ([WireMock.Net.RestClient](https://www.nuget.org/packages/WireMock.Net.RestClient)) to access all the methods described on this page.
|
||||||
|
```c#
|
||||||
|
// Create an implementation of the IWireMockAdminApi and pass in the base URL for the API.
|
||||||
|
var api = RestClient.For<IWireMockAdminApi>("http://localhost:9091");
|
||||||
|
|
||||||
|
// Set BASIC Authorization
|
||||||
|
api.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes("foo:bar")));
|
||||||
|
|
||||||
|
// Call API
|
||||||
|
var settings = await api.GetSettingsAsync();
|
||||||
|
```
|
||||||
|
|
||||||
## Supported interfaces
|
## Supported interfaces
|
||||||
The following interfaces are supported:
|
The following interfaces are supported:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user