Skip to main content
MockServer’s REST API lets you create expectations, verify requests, retrieve recorded traffic, and manage server state — all over HTTP. Every control endpoint uses PUT, and request bodies are JSON.
The full API is documented as an OpenAPI 3 specification on SwaggerHub. Use it for interactive exploration and schema details.

Base URL

By default, MockServer listens on port 1080:
For TLS connections, use https://localhost:1080. Pass -k (or --insecure) with curl when MockServer uses a self-signed certificate.

Conventions

  • All control endpoints use the PUT HTTP method.
  • Request bodies are JSON. Set Content-Type: application/json if your client requires it.
  • Responses use standard HTTP status codes to indicate success or failure.
  • MockServer returns 400 Bad Request with a descriptive message when the request body fails JSON schema validation.

Endpoints

Quick example

Create an expectation and then verify it was matched:

HTTP status codes