whenDelete method
void
whenDelete(})
Adds a fake response definition for a DELETE request to the provided
pathOrTemplate
. If the response is not a CharlatanHttpResponse then
the statusCode
will be used.
Implementation
void whenDelete(
String pathOrTemplate,
CharlatanResponseBuilder responseBuilder, {
int statusCode = 200,
}) {
_matchers.insert(
0,
CharlatanResponseDefinition(
description: 'DELETE $pathOrTemplate',
requestMatcher: requestMatchesAll([
requestMatchesHttpMethod('delete'),
requestMatchesPathOrTemplate(pathOrTemplate),
]),
responseBuilder: responseBuilder,
defaultStatusCode: statusCode,
),
);
}