responds With Status
Associates the current RequestSpecification with a body-free response carrying only an HTTP status code.
This is the idiomatic shortcut when no response body is needed:
mokksy.get { path("/ping") } respondsWithStatus HttpStatusCode.NoContent
mokksy.get { path("/gone") } respondsWithStatus HttpStatusCode.GoneContent copied to clipboard
When a body is needed, use respondsWith with a typed lambda:
mokksy.get { path("/data") } respondsWith { body = MyResponse("ok") }Content copied to clipboard
Parameters
status
The HTTP status code to return.