respondsWithStatus

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.Gone

When a body is needed, use respondsWith with a typed lambda:

mokksy.get { path("/data") } respondsWith { body = MyResponse("ok") }

Parameters

status

The HTTP status code to return.