diff --git a/Admin-API-Reference.md b/Admin-API-Reference.md index c9dce39..08beb73 100644 --- a/Admin-API-Reference.md +++ b/Admin-API-Reference.md @@ -7,6 +7,19 @@ var server = FluentMockServer.StartWithAdminInterface(); # API definition 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("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 The following interfaces are supported: