diff --git a/Admin-API-Reference.md b/Admin-API-Reference.md index 1c3d9f4..5796df4 100644 --- a/Admin-API-Reference.md +++ b/Admin-API-Reference.md @@ -249,13 +249,10 @@ Example : `11111110-a633-40e8-a244-5cb80bc0ab66.json` ``` ### `DELETE /__admin/mappings` -Delete all stub mappings. +Delete all stub mappings. (If there is no request body). ### `DELETE /__admin/mappings` -Delete all stub mappings matched to the GUIDs in the body of request. -NOTE: `AllowBodyForAllHttpMethods` must be set to true in Admin Settings for this feature to work. Otherwise, body will arrive to the service empty and delete all stub mappings. - -Delete an existing stub mapping (identical to the POST request, but deletes instead of create) +Delete the stub mappings matched to the GUIDs in the request body. Example request: ```js @@ -265,52 +262,27 @@ Example 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}}" }, + "Body": "Response Body", "Headers": { - "Content-Type": "application/json", "a" : "b" - }, - "Delay": 10 + "Content-Type": "application/json" + } } - } +} ``` - -This is also valid syntax for the request (demonstrates multi-delete): - +The only truly necessary piece of the body json is the Guid. +So this is also valid syntax for the request (demonstrates multi-delete): +```js [{ "Guid": "dae02a0d-8a33-46ed-aab0-afbecc8643e3" }, { "Guid": "c181c4f6-fe48-4712-8390-e1a4b358e278" }] +``` +The most obvious application of DELETE with request body will be the ability to send identical requests to the __admin/mappings endpoint using POST and DELETE interchangeably. Additionally, this provides a useful "multi-delete" feature. ### `GET /__admin/mappings/{guid}` Get a single stub mapping