mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-11 03:06:48 +02:00
Updated Admin API Reference (markdown)
@@ -13,8 +13,7 @@ The mappings defined in the mock service.
|
|||||||
* `POST /__admin/mappings` --> Create a new stub mapping
|
* `POST /__admin/mappings` --> Create a new stub mapping
|
||||||
* `DELETE /__admin/mappings` --> TODO
|
* `DELETE /__admin/mappings` --> TODO
|
||||||
* `GET /__admin/mappings/{guid}` --> Get a single stub mapping
|
* `GET /__admin/mappings/{guid}` --> Get a single stub mapping
|
||||||
* `PUT /__admin/mappings/{guid}` --> TODO
|
* `PUT /__admin/mappings/{guid}` --> Update a stub mapping
|
||||||
* `POST /__admin/mappings/{guid}` --> TODO
|
|
||||||
* `DELETE /__admin/mappings/{guid}` --> TODO
|
* `DELETE /__admin/mappings/{guid}` --> TODO
|
||||||
|
|
||||||
### /__admin/requests
|
### /__admin/requests
|
||||||
@@ -119,16 +118,95 @@ Example response:
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## `POST /__admin/mappings`
|
||||||
|
Create a new stub mapping
|
||||||
|
|
||||||
|
Example request:
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
"Guid": "dae02a0d-8a33-46ed-aab0-afbecc8643e3",
|
||||||
|
"Request": {
|
||||||
|
"Url": "/testabc",
|
||||||
|
"Methods": [
|
||||||
|
"put"
|
||||||
|
],
|
||||||
|
"Headers": [
|
||||||
|
{
|
||||||
|
"Name": "Content-Type",
|
||||||
|
"Matchers": [
|
||||||
|
{
|
||||||
|
"Name": "WildcardMatcher",
|
||||||
|
"Pattern": "application/*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Cookies": [],
|
||||||
|
"Params": [
|
||||||
|
{
|
||||||
|
"Name": "start",
|
||||||
|
"Values": [ "1000", "1001" ]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Body": {
|
||||||
|
"Matcher": {
|
||||||
|
"Name": "JsonPathMatcher",
|
||||||
|
"Pattern": "$.things[?(@.name == 'RequiredThing')]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"UseTransformer": true,
|
||||||
|
"StatusCode": 205,
|
||||||
|
"BodyAsJson": { "result": "test - {{request.path}}" },
|
||||||
|
"Headers": {
|
||||||
|
"Content-Type": "application/json", "a" : "b"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## `DELETE /__admin/mappings`
|
||||||
|
TODO
|
||||||
|
|
||||||
|
### `GET /__admin/mappings/{guid}`
|
||||||
|
Get a single stub mapping
|
||||||
|
|
||||||
|
### `PUT /__admin/mappings/{guid}`
|
||||||
|
Update a single stub mapping
|
||||||
|
|
||||||
|
Example request
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
"Request": {
|
||||||
|
"Path": {
|
||||||
|
"Matchers": []
|
||||||
|
},
|
||||||
|
"Methods": [
|
||||||
|
"get"
|
||||||
|
],
|
||||||
|
"Headers": [],
|
||||||
|
"Cookies": [],
|
||||||
|
"Params": [
|
||||||
|
{
|
||||||
|
"Name": "start",
|
||||||
|
"Values": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Body": {}
|
||||||
|
},
|
||||||
|
"Response": {
|
||||||
|
"StatusCode": 205,
|
||||||
|
"Body": "{\"msg\": \"Hello world?\"",
|
||||||
|
"UseTransformer": true,
|
||||||
|
"Headers": {
|
||||||
|
"Transformed-Postman-Token": "token is {{request.headers.Postman-Token}}",
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### `GET /__admin/mappings` --> Gets all defined mappings
|
|
||||||
### `POST /__admin/mappings` --> Create a new stub mapping
|
|
||||||
### `DELETE /__admin/mappings` --> TODO
|
|
||||||
### `GET /__admin/mappings/{guid}` --> Get a single stub mapping
|
|
||||||
### `PUT /__admin/mappings/{guid}` --> TODO
|
|
||||||
### `POST /__admin/mappings/{guid}` --> TODO
|
### `POST /__admin/mappings/{guid}` --> TODO
|
||||||
### `DELETE /__admin/mappings/{guid}` --> TODO
|
### `DELETE /__admin/mappings/{guid}` --> TODO
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user