MockServer can be controlled in the following ways:

The following activities are supported:

 

REST API

The REST API is documented using Open API 3 — the same specification is also served locally at /mockserver-openapi.yaml.

 

Java Client

The Java client has the following versions:

Install via Maven:

<dependency>
    <groupId>org.mock-server</groupId>
    <artifactId>mockserver-client-java</artifactId>
    <version>9.1.0</version>
</dependency>

Create an expectation:

import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;

new MockServerClient("localhost", 1080)
    .when(
        request().withMethod("GET").withPath("/hello")
    )
    .respond(
        response().withStatusCode(200).withBody("world")
    );

The constructors above are fully supported. As a more discoverable alternative, a fluent builder() covers every construction option (host, port, context path, TLS, control plane JWT, proxy configuration and request override) with sensible defaults (localhost, 1080):

MockServerClient client = MockServerClient.builder()
    .host("localhost")
    .port(1080)
    .secure(true)
    .build();

Verify a request was received:

import static org.mockserver.model.HttpRequest.request;
import org.mockserver.verify.VerificationTimes;

new MockServerClient("localhost", 1080)
    .verify(
        request().withPath("/some/path"),
        VerificationTimes.atLeast(1)
    );

Importing documents and expectations

importExpectations(json) and importExpectationsFromFile(path) load one or more MockServer expectations (a single object or an array — the same shape produced by retrieveActiveExpectations(...), written by --persist, or exported from the dashboard) and upsert them, creating or updating by id. importDocument(json, format) wraps PUT /mockserver/import to import a HAR, Postman collection, or Pact contract instead — format is one of har, postman, pact, or blank to auto-detect from the JSON shape:

Expectation[] fromJson = mockServerClient.importExpectationsFromFile("fixtures/my-expectations.json");
Expectation[] fromPostman = mockServerClient.importDocument(postmanCollectionJson, "postman");

The REST endpoint also accepts format=wiremock, mountebank, or mockoon to migrate stubs/imposters/environments from those tools, and format=recording to re-import a persisted NDJSON archive of recorded request/response pairs into the event log instead of creating expectations. Call the REST endpoint directly for all four of these — not importDocument. The three migration formats respond {"expectations": [...], "warnings": [...]} (so any foreign construct that could not be faithfully mapped is surfaced rather than silently dropped) so importDocument, which expects a plain expectation array, throws an IllegalArgumentException for them after the server has already applied the import. recording responds with recorded request/response pairs, which importDocument silently turns into Expectation objects that were never registered, so its return value is wrong rather than an error:

curl -v -X PUT "http://localhost:1080/mockserver/import?format=wiremock" -d @wiremock-stubs.json

Operating mode and load scenarios

retrieveMode() reads the current high-level operating mode (GET /mockserver/mode), the counterpart to setMode(MockMode); deleteLoadScenario(name) removes a single registered load scenario (stopping it first if running) via DELETE /mockserver/loadScenario/{name}:

MockMode currentMode = mockServerClient.retrieveMode();
mockServerClient.deleteLoadScenario("checkout-burst");

Replay and metrics

replay(HttpRequest) re-issues a previously captured request to its upstream target (resolved from its Host header or explicit socketAddress) and returns the live upstream response — distinct from expectation matching, it is for re-running one recorded call against the real service. scrapeMetrics() wraps GET /mockserver/metrics and returns the server's response body as a String — the Prometheus exposition text when metricsEnabled is true, or null when it is false (the server answers 404 with no body), so check for null before using the result. Distinct from retrieveMetrics(), which returns the JSON counter snapshot via PUT /mockserver/retrieve?type=METRICS:

HttpResponse upstreamResponse = mockServerClient.replay(
    request().withMethod("GET").withPath("/orders/123").withHeader("Host", "api.example.com")
);
String prometheusText = mockServerClient.scrapeMetrics();

The full log entry body behind a truncated dashboard update frame (GET /mockserver/logEntryBody?id=<log entry id>&part=request|response) has no dedicated Java client wrapper; call it directly if your tool needs an untruncated body by log entry id.

Control-plane authorisation and lifecycle

withControlPlaneJWT(String) (or the Supplier<String> overload, re-evaluated on every request — useful for a short-lived token that is refreshed) attaches a JWT to every control-plane request when control plane authorisation is enabled server-side:

MockServerClient client = new MockServerClient("localhost", 1080)
    .withControlPlaneJWT(() -> tokenCache.currentToken());

Lifecycle and connection-state methods: hasStarted() / hasStopped() poll (with optional attempts/timeout overloads) until the server answers or stops answering; isRunning() also polls (10 attempts, 500ms apart, by default — same as its isRunning(attempts, timeout, timeUnit) overload with explicit arguments) but is @Deprecated in favour of hasStarted() / hasStopped(); stopAsync() stops the server without blocking, returning a Future<MockServerClient>; isSecure() reports whether this client talks TLS; remoteAddress() returns the InetSocketAddress this client connects to.

Retrieving by expectation id

Every retrieve... family has an *ById(expectationId) variant that scopes the result to one expectation: retrieveActiveExpectationsById, retrieveRecordedExpectationsById, retrieveRecordedRequestsById, and retrieveRecordedRequestsAndResponsesById each additionally have a Format overload for the serialized-string form; retrieveLogMessagesById (returns the joined log text as a String) and retrieveLogMessagesArrayById (the same text split into a String[]) do not take a Format — there is only the one text representation for logs.

 

Spring Boot Starter

For Spring Boot applications, the mockserver-spring-boot-starter auto-configures a local MockServer and exposes an injectable MockServerClient bean. It is intended for local development and integration testing (it starts a real embedded MockServer) and is disabled by default, so adding it to the classpath never changes application behaviour on its own.

Install via Maven:

<dependency>
    <groupId>org.mock-server</groupId>
    <artifactId>mockserver-spring-boot-starter</artifactId>
    <version>9.1.0</version>
    <scope>test</scope>
</dependency>

Enable it and (optionally) choose a port in application.properties — use a dev or test profile so it never activates in production:

mockserver.enabled=true
mockserver.port=1080
# optional:
# mockserver.initialization-json=classpath:initializerJson.json
# mockserver.log-level=WARN
PropertyDefaultDescription
mockserver.enabledfalseMaster switch — start MockServer and register the bean
mockserver.port0Port to bind; 0 picks a free ephemeral port (read the real port from the bean via getPort())
mockserver.initialization-json Path to an initialization JSON file of expectations to preload
mockserver.log-level MockServer log level (WARN, INFO, DEBUG, OFF)

Then inject the client anywhere in your application context:

import org.mockserver.client.MockServerClient;
import static org.mockserver.model.HttpRequest.request;
import static org.mockserver.model.HttpResponse.response;

@Service
class MyClient {
    MyClient(MockServerClient mockServerClient) {
        mockServerClient
            .when(request().withMethod("GET").withPath("/hello"))
            .respond(response().withStatusCode(200).withBody("world"));
    }
}

The server starts when the Spring context refreshes and stops when it closes. A single bean is registered, so it is injectable as either MockServerClient or ClientAndServer; declare your own bean to override the auto-configured one.

 

JavaScript Client

The JavaScript client has the following version:

To include the browser based client in an HTML page as follows:

<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>

Or install the Node.js module via npm:

npm install mockserver-client --save-dev

Create an expectation:

const mockServerClient = require('mockserver-client').mockServerClient;

mockServerClient("localhost", 1080).mockAnyResponse({
    httpRequest: { method: "GET", path: "/hello" },
    httpResponse: { statusCode: 200, body: "world" }
});

Verify a request was received:

const mockServerClient = require('mockserver-client').mockServerClient;

mockServerClient("localhost", 1080)
    .verify({ path: "/some/path" }, 1)
    .then(
        function () { /* request was received at least once */ },
        function () { /* verification failed */ }
    );

For jest, vitest, mocha, or node:test, the client also ships a framework-agnostic setupMockServer() helper that starts and stops MockServer (via mockserver-node) and hands back a ready client plus an idempotent stop():

const { setupMockServer } = require('mockserver-client/setupMockServer');

let mockServer;
beforeAll(async () => { mockServer = await setupMockServer({ serverPort: 1080 }); });
afterAll(async () => { await mockServer.stop(); });

test('responds', async () => {
    await mockServer.client.mockAnyResponse({
        httpRequest: { path: "/hello" },
        httpResponse: { body: "world" }
    });
});

Closing callback WebSockets

client.close() closes the callback WebSocket(s) opened for mockWithCallback, the callback/forwardCallback actions, and breakpoints, so they stop keeping the process alive. These WebSockets are tracked in a module-level registry keyed by host:port[contextPath], not per client instance — so calling close() on any mockServerClient(...) instance pointed at the same host/port/contextPath closes the WebSocket(s) shared by every such instance in the current process, not just the one you called it on. It sends nothing to MockServer — the server-side expectations and breakpoints that use those WebSockets simply stop working until a later callback or breakpoint opens a new one. client.reset() also closes them (as close() does) in addition to clearing server-side state:

const mockServerClient = require('mockserver-client').mockServerClient;

const client = mockServerClient("localhost", 1080);
// ... use client for callbacks/breakpoints ...
await client.close(); // stop the callback WebSocket(s) keeping the process alive

Callback WebSocket timeout

The optional options argument to mockServerClient(host, port, contextPath, tls, caCertPemFilePath, options) accepts callbackWebSocketTimeoutMillis: how long a callback or breakpoint waits for its WebSocket to receive its client id before giving up (default 10000). Also in options: bearerToken / bearerTokenSupplier for control-plane auth, and clientCertPemFilePath / clientKeyPemFilePath for mutual TLS.

const mockServerClient = require('mockserver-client').mockServerClient;

const client = mockServerClient("localhost", 1080, undefined, false, undefined, {
    callbackWebSocketTimeoutMillis: 30000
});

Package exports and module imports

Since 9.0.0 the package's package.json resolves every importable path through an explicit exports map rather than a bare main field — require/import of anything not listed there (e.g. an undocumented deep path into the package) now fails to resolve, where it may previously have worked by accident. The supported subpaths are mockserver-client (or mockserver-client/index), mockserver-client/mockServerClient (the module directly, bypassing the top-level index.js re-export), mockserver-client/llm, mockserver-client/mcpMockBuilder, mockserver-client/a2aMockBuilder, mockserver-client/setupMockServer, mockserver-client/sendRequest, mockserver-client/webSocketClient, and the types-only mockserver-client/mockServer / mockserver-client/llmTypes.

Named ES-module imports now work — previously only the default import resolved correctly:

// now works (previously only the default import did):
import { mockServerClient, MockMode, setupMockServer, llm, mcpMock, a2aMock } from 'mockserver-client';

TypeScript typings are published for both this client and the companion mockserver-node launcher package, and both need @types/node installed in a consuming TypeScript project: mockserver-client's own mockServerClient.d.ts references the ambient Buffer type (e.g. in storeBinaryFile and uploadGrpcDescriptor's parameter types) without importing it, and mockserver-node's typings use Node's own built-in types for the process/child-process APIs it wraps. If your tsconfig.json sets an explicit "types" array, "node" must be listed in it or these ambient declarations are not picked up. import mockserver = require(...) and import * as mockserver from ... work with or without esModuleInterop; a default import needs esModuleInterop enabled and is otherwise a compile error.

 

Python Client

The Python client provides both synchronous and asynchronous APIs:

  • MockServerClient - synchronous client wrapping the async implementation
  • AsyncMockServerClient - native async client using asyncio

Install via pip:

pip install mockserver-client

The synchronous client supports context manager usage:

from mockserver import MockServerClient, HttpRequest, HttpResponse

with MockServerClient("localhost", 1080) as client:
    client.when(
        HttpRequest(path="/hello")
    ).respond(
        HttpResponse(status_code=200, body="world")
    )

The async client can be used with async with:

from mockserver import AsyncMockServerClient, HttpRequest, HttpResponse

async with AsyncMockServerClient("localhost", 1080) as client:
    await client.when(
        HttpRequest(path="/hello")
    ).respond(
        HttpResponse(status_code=200, body="world")
    )

Verification failures raise MockServerVerificationError (a subclass of both MockServerError and AssertionError). Connection failures raise MockServerConnectionError:

from mockserver import MockServerClient, HttpRequest, VerificationTimes
from mockserver.exceptions import MockServerVerificationError, MockServerConnectionError

try:
    with MockServerClient("localhost", 1080) as client:
        client.verify(HttpRequest(path="/some/path"), times=VerificationTimes(at_least=1))
except MockServerVerificationError as e:
    print(f"Verification failed: {e}")
except MockServerConnectionError as e:
    print(f"Connection failed: {e}")

Requires Python >= 3.9.

The client also ships a pytest fixture, registered automatically on install, so tests can request a ready, reset client with no conftest.py wiring. The mockserver fixture connects to a running server when MOCKSERVER_HOST / MOCKSERVER_PORT are set, otherwise it launches a self-contained binary for the test session, and resets the server before and after every test:

from mockserver import HttpRequest, HttpResponse

def test_hello(mockserver):
    mockserver.when(
        HttpRequest(path="/hello")
    ).respond(
        HttpResponse(status_code=200, body="world")
    )
 

Ruby Client

The Ruby client provides a fluent builder DSL and WebSocket-based callback support:

  • MockServer::Client - makes HTTP requests to a remote MockServer instance

Install via gem:

gem install mockserver-client

The client supports a block form for automatic cleanup:

require 'mockserver-client'

MockServer::Client.new('localhost', 1080) do |client|
  client.when(
    MockServer::HttpRequest.new(path: '/hello')
  ).respond(
    MockServer::HttpResponse.new(body: 'world')
  )
end

You can include MockServer to use shorter class names (e.g. HttpRequest instead of MockServer::HttpRequest). All accordion examples below use this pattern for brevity.

Verification failures raise MockServer::VerificationError. Connection failures raise MockServer::ConnectionError:

require 'mockserver-client'
include MockServer

MockServer::Client.new('localhost', 1080) do |client|
  client.verify(HttpRequest.new(path: '/some/path'), times: VerificationTimes.at_least(1))
rescue MockServer::VerificationError => e
  puts "Verification failed: #{e.message}"
rescue MockServer::ConnectionError => e
  puts "Connection failed: #{e.message}"
end

Requires Ruby >= 3.0.

 

Go Client

The Go client provides a fluent builder API with zero third-party dependencies (standard library only):

  • mockserver.Client - makes HTTP requests to a remote MockServer instance

Install via go get:

go get github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9@latest

Create an expectation using the fluent API:

import mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"

client := mockserver.New("localhost", 1080)
client.When(
    mockserver.Request().Method("GET").Path("/hello"),
).Respond(
    mockserver.Response().StatusCode(200).Body("world"),
)

Verification failures return a *mockserver.VerificationError:

import mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"

client := mockserver.New("localhost", 1080)
err := client.Verify(
    mockserver.Request().Path("/some/path"),
    mockserver.AtLeast(1),
)
if err != nil {
    log.Fatal(err)
}

Requires Go >= 1.21.

Available from MockServer 9.1.0 — the module is published (tag mockserver-client-go/v9.1.0) with that release.

 

.NET Client

The .NET client provides a fluent builder API with synchronous and async variants for all operations:

  • MockServerClient - makes HTTP requests to a remote MockServer instance

The NuGet package is MockServerClient (the C# namespace remains MockServer.Client). Install via dotnet add:

dotnet add package MockServerClient

Or via PackageReference in your .csproj:

<PackageReference Include="MockServerClient" Version="9.1.0" />

Available from MockServer 9.1.0 — the MockServerClient package is published to NuGet with that release.

Create an expectation using the fluent API:

using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.When(
    HttpRequest.Request()
        .WithMethod("GET")
        .WithPath("/hello")
).Respond(
    HttpResponse.Response()
        .WithStatusCode(200)
        .WithBody("world")
);

Verification failures throw VerificationException. Connection failures throw MockServerClientException:

using MockServer.Client;
using MockServer.Client.Models;
using MockServer.Client.Exceptions;

try
{
    using var client = new MockServerClient("localhost", 1080);
    client.Verify(
        HttpRequest.Request().WithPath("/some/path"),
        VerificationTimes.AtLeastTimes(1)
    );
}
catch (VerificationException e)
{
    Console.WriteLine($"Verification failed: {e.Message}");
}
catch (MockServerClientException e)
{
    Console.WriteLine($"Connection failed: {e.Message}");
}

Supports .NET Standard 2.0 (.NET Framework 4.6.1+, .NET Core 2.0+, and Mono 5.4+) and .NET 8.0.

 

Rust Client

The Rust client provides a fluent builder API using the blocking reqwest client:

  • MockServerClient - makes HTTP requests to a remote MockServer instance

Add to your Cargo.toml:

[dev-dependencies]
mockserver-client = "9.1.0"

Create an expectation using the fluent API:

use mockserver_client::{ClientBuilder, HttpRequest, HttpResponse};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.when(HttpRequest::new().method("GET").path("/hello"))
    .respond(HttpResponse::new().status_code(200).body("world"))
    .unwrap();

Verification failures return Err(Error::VerificationFailure):

use mockserver_client::{ClientBuilder, HttpRequest, VerificationTimes};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.verify(
    HttpRequest::new().path("/some/path"),
    VerificationTimes::at_least(1),
).unwrap();

Requires Rust 2021 edition.

Available from MockServer 9.1.0 — the mockserver-client crate is published to crates.io with that release.

 

PHP Client

The PHP client provides a fluent builder API using Guzzle for HTTP transport:

  • MockServerClient - makes HTTP requests to a remote MockServer instance

Install via Composer:

composer require mock-server/mockserver-client

Create an expectation using the fluent API:

use MockServer\MockServerClient;
use MockServer\HttpRequest;
use MockServer\HttpResponse;

$client = new MockServerClient('localhost', 1080);
$client->when(
    HttpRequest::request()->method('GET')->path('/hello')
)->respond(
    HttpResponse::response()->statusCode(200)->body('world')
);

Verification failures throw MockServer\Exception\VerificationException. Connection failures throw MockServer\Exception\ConnectionException:

use MockServer\MockServerClient;
use MockServer\HttpRequest;
use MockServer\VerificationTimes;
use MockServer\Exception\VerificationException;
use MockServer\Exception\ConnectionException;

try {
    $client = new MockServerClient('localhost', 1080);
    $client->verify(
        HttpRequest::request()->path('/some/path'),
        VerificationTimes::atLeast(1)
    );
} catch (VerificationException $e) {
    echo "Verification failed: " . $e->getMessage();
} catch (ConnectionException $e) {
    echo "Connection failed: " . $e->getMessage();
}

Requires PHP >= 8.1.

Available from MockServer 9.1.0 — the mock-server/mockserver-client package is published to Packagist with that release.

 
new MockServerClient("localhost", 1080)
    .when(
        request()
            .withMethod("GET")
            .withPath("/view/cart")
            .withCookies(
                cookie("session", "4930456C-C718-476F-971F-CB8E047AB349")
            )
            .withQueryStringParameters(
                param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
            )
    )
    .respond(
        response()
            .withBody("some_response_body")
    );
new ClientAndServer(1080)
    .when(
        request()
            .withMethod("GET")
            .withPath("/view/cart")
            .withCookies(
                cookie("session", "4930456C-C718-476F-971F-CB8E047AB349")
            )
            .withQueryStringParameters(
                param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
            )
    )
    .respond(
        response()
            .withBody("some_response_body")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .mockAnyResponse({
    "httpRequest": {
      "method": "GET",
      "path": "/view/cart",
      "queryStringParameters": {
        "cartId": ["055CA455-1DF7-45BB-8535-4F83E7266092"]
      },
      "cookies": {
        "session": "4930456C-C718-476F-971F-CB8E047AB349"
      }
    },
    "httpResponse": {
      "body": "some_response_body"
    }
  })
  .then(
    function () {
      console.log("expectation created");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .mockAnyResponse({
      "httpRequest": {
        "method": "GET",
        "path": "/view/cart",
        "queryStringParameters": {
          "cartId": ["055CA455-1DF7-45BB-8535-4F83E7266092"]
        },
        "cookies": {
          "session": "4930456C-C718-476F-971F-CB8E047AB349"
        }
      },
      "httpResponse": {
        "body": "some_response_body"
      }
    })
    .then(
      function () {
        console.log("expectation created");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest, HttpResponse, KeyToMultiValue

client = MockServerClient("localhost", 1080)
client.when(
    HttpRequest(
        method="GET",
        path="/view/cart",
        cookies=[KeyToMultiValue(name="session", values=["4930456C-C718-476F-971F-CB8E047AB349"])],
        query_string_parameters=[KeyToMultiValue(name="cartId", values=["055CA455-1DF7-45BB-8535-4F83E7266092"])]
    )
).respond(
    HttpResponse(body="some_response_body")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
client.when(
  HttpRequest.new(
    method: 'GET',
    path: '/view/cart',
    cookies: [{ name: 'session', values: ['4930456C-C718-476F-971F-CB8E047AB349'] }],
    query_string_parameters: [{ name: 'cartId', values: ['055CA455-1DF7-45BB-8535-4F83E7266092'] }]
  )
).respond(
  HttpResponse.new(body: 'some_response_body')
)
import mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"

client := mockserver.New("localhost", 1080)
client.When(
    mockserver.Request().
        Method("GET").
        Path("/view/cart").
        Cookie("session", "4930456C-C718-476F-971F-CB8E047AB349").
        QueryStringParameter("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092"),
).Respond(
    mockserver.Response().Body("some_response_body"),
)
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.Upsert(new Expectation
{
    HttpRequest = new HttpRequest
    {
        Method = "GET",
        Path = "/view/cart",
        QueryStringParameters = new Dictionary<string, List<string>>
        {
            { "cartId", new List<string> { "055CA455-1DF7-45BB-8535-4F83E7266092" } }
        },
        Cookies = new Dictionary<string, string>
        {
            { "session", "4930456C-C718-476F-971F-CB8E047AB349" }
        }
    },
    HttpResponse = new HttpResponse { Body = "some_response_body" }
});
use mockserver_client::{ClientBuilder, HttpRequest, HttpResponse};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.when(
    HttpRequest::new()
        .method("GET")
        .path("/view/cart")
        .query_param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
        .cookie("session", "4930456C-C718-476F-971F-CB8E047AB349"),
).respond(
    HttpResponse::new().body("some_response_body"),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;
use MockServer\HttpResponse;

$client = new MockServerClient('localhost', 1080);
$client->when(
    HttpRequest::request()
        ->method('GET')
        ->path('/view/cart')
        ->cookie('session', '4930456C-C718-476F-971F-CB8E047AB349')
        ->queryStringParameter('cartId', '055CA455-1DF7-45BB-8535-4F83E7266092')
)->respond(
    HttpResponse::response()->body('some_response_body')
);
curl -v -X PUT "http://localhost:1080/mockserver/expectation" -d '{
  "httpRequest" : {
    "method" : "GET",
    "path" : "/view/cart",
    "queryStringParameters" : {
      "cartId" : [ "055CA455-1DF7-45BB-8535-4F83E7266092" ]
    },
    "cookies" : {
      "session" : "4930456C-C718-476F-971F-CB8E047AB349"
    }
  },
  "httpResponse" : {
    "body" : "some_response_body"
  }
}'
new MockServerClient("localhost", 1080)
    .withSecure(true)
    .when(
        request()
            .withMethod("GET")
            .withPath("/view/cart")
            .withCookies(
                cookie("session", "4930456C-C718-476F-971F-CB8E047AB349")
            )
            .withQueryStringParameters(
                param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
            )
    )
    .respond(
        response()
            .withBody("some_response_body")
    );
new ClientAndServer(1080)
    .withSecure(true)
    .when(
        request()
            .withMethod("GET")
            .withPath("/view/cart")
            .withCookies(
                cookie("session", "4930456C-C718-476F-971F-CB8E047AB349")
            )
            .withQueryStringParameters(
                param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
            )
    )
    .respond(
        response()
            .withBody("some_response_body")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080, undefined, true)
  .mockAnyResponse({
    "httpRequest": {
      "method": "GET",
      "path": "/view/cart",
      "queryStringParameters": {
        "cartId": ["055CA455-1DF7-45BB-8535-4F83E7266092"]
      },
      "cookies": {
        "session": "4930456C-C718-476F-971F-CB8E047AB349"
      }
    },
    "httpResponse": {
      "body": "some_response_body"
    }
  })
  .then(
    function () {
      console.log("expectation created");
    },
    function (error) {
      console.log(error);
    }
  );
from mockserver import MockServerClient, HttpRequest, HttpResponse, KeyToMultiValue

client = MockServerClient("localhost", 1080, secure=True, tls_verify=False)
client.when(
    HttpRequest(
        method="GET",
        path="/view/cart",
        cookies=[KeyToMultiValue(name="session", values=["4930456C-C718-476F-971F-CB8E047AB349"])],
        query_string_parameters=[KeyToMultiValue(name="cartId", values=["055CA455-1DF7-45BB-8535-4F83E7266092"])]
    )
).respond(
    HttpResponse(body="some_response_body")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080, secure: true, tls_verify: false)
client.when(
  HttpRequest.new(
    method: 'GET',
    path: '/view/cart',
    cookies: [{ name: 'session', values: ['4930456C-C718-476F-971F-CB8E047AB349'] }],
    query_string_parameters: [{ name: 'cartId', values: ['055CA455-1DF7-45BB-8535-4F83E7266092'] }]
  )
).respond(
  HttpResponse.new(body: 'some_response_body')
)
import mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"

client := mockserver.New("localhost", 1080, mockserver.WithTLS())
client.When(
    mockserver.Request().
        Method("GET").
        Path("/view/cart").
        Cookie("session", "4930456C-C718-476F-971F-CB8E047AB349").
        QueryStringParameter("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092"),
).Respond(
    mockserver.Response().Body("some_response_body"),
)
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080, secure: true);
client.When(
    HttpRequest.Request()
        .WithMethod("GET")
        .WithPath("/view/cart")
        .WithQueryStringParameter("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092")
).Respond(
    HttpResponse.Response().WithBody("some_response_body")
);
use mockserver_client::{ClientBuilder, HttpRequest, HttpResponse};

let client = ClientBuilder::new("localhost", 1080)
    .secure(true)
    .tls_verify(false)
    .build()
    .unwrap();
client.when(
    HttpRequest::new()
        .method("GET")
        .path("/view/cart")
        .query_param("cartId", "055CA455-1DF7-45BB-8535-4F83E7266092"),
).respond(
    HttpResponse::new().body("some_response_body"),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;
use MockServer\HttpResponse;

$client = new MockServerClient('localhost', 1080, secure: true, guzzleOptions: [
    'verify' => false,
]);
$client->when(
    HttpRequest::request()
        ->method('GET')
        ->path('/view/cart')
        ->queryStringParameter('cartId', '055CA455-1DF7-45BB-8535-4F83E7266092')
)->respond(
    HttpResponse::response()->body('some_response_body')
);
curl -v -k -X PUT "https://localhost:1080/mockserver/expectation" -d '{
  "httpRequest" : {
    "method" : "GET",
    "path" : "/view/cart",
    "queryStringParameters" : {
      "cartId" : [ "055CA455-1DF7-45BB-8535-4F83E7266092" ]
    },
    "cookies" : {
      "session" : "4930456C-C718-476F-971F-CB8E047AB349"
    }
  },
  "httpResponse" : {
    "body" : "some_response_body"
  }
}'
new MockServerClient("localhost", 1080)
    .verify(
        request()
            .withPath("/some/path"),
        VerificationTimes.atLeast(2)
    );
new ClientAndServer(1080)
    .verify(
        request()
            .withPath("/some/path"),
        VerificationTimes.atLeast(2)
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .verify(
    {
      'path': '/some/path'
    }, 2)
  .then(
    function () {
      console.log("request found at least 2 times");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .verify(
      {
        'path': '/some/path'
      }, 2)
    .then(
      function () {
        console.log("request found at least 2 times");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest, VerificationTimes

client = MockServerClient("localhost", 1080)
client.verify(
    HttpRequest(path="/some/path"),
    times=VerificationTimes(at_least=2)
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
client.verify(
  HttpRequest.new(path: '/some/path'),
  times: VerificationTimes.at_least(2)
)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
err := client.Verify(
    mockserver.Request().Path("/some/path"),
    mockserver.AtLeast(2),
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.Verify(
    HttpRequest.Request().WithPath("/some/path"),
    VerificationTimes.AtLeastTimes(2)
);
use mockserver_client::{ClientBuilder, HttpRequest, VerificationTimes};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.verify(
    HttpRequest::new().path("/some/path"),
    VerificationTimes::at_least(2),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;
use MockServer\VerificationTimes;

$client = new MockServerClient('localhost', 1080);
$client->verify(
    HttpRequest::request()->path('/some/path'),
    VerificationTimes::atLeast(2)
);
curl -v -X PUT "http://localhost:1080/mockserver/verify" -d '{
    "httpRequest": {
        "path": "/some/path"
    },
    "times": {
        "atLeast": 2
    }
}'
new MockServerClient("localhost", 1080)
    .verify(
        request()
            .withPath("/some/path/one"),
        request()
            .withPath("/some/path/two"),
        request()
            .withPath("/some/path/three")
    );
new ClientAndServer(1080)
    .verify(
        request()
            .withPath("/some/path/one"),
        request()
            .withPath("/some/path/two"),
        request()
            .withPath("/some/path/three")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .verifySequence(
    {
      'path': '/some/path/one'
    },
    {
      'path': '/some/path/two'
    },
    {
      'path': '/some/path/three'
    }
  )
  .then(
    function () {
      console.log("request sequence found in the order specified");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .verifySequence(
      {
        'path': '/some/path/one'
      },
      {
        'path': '/some/path/two'
      },
      {
        'path': '/some/path/three'
      }
    )
    .then(
      function () {
        console.log("request sequence found in the order specified");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
client.verify_sequence(
    HttpRequest(path="/some/path/one"),
    HttpRequest(path="/some/path/two"),
    HttpRequest(path="/some/path/three")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
client.verify_sequence(
  HttpRequest.new(path: '/some/path/one'),
  HttpRequest.new(path: '/some/path/two'),
  HttpRequest.new(path: '/some/path/three')
)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
err := client.VerifySequence(
    mockserver.Request().Path("/some/path/one"),
    mockserver.Request().Path("/some/path/two"),
    mockserver.Request().Path("/some/path/three"),
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.VerifySequence(
    HttpRequest.Request().WithPath("/some/path/one"),
    HttpRequest.Request().WithPath("/some/path/two"),
    HttpRequest.Request().WithPath("/some/path/three")
);
use mockserver_client::{ClientBuilder, HttpRequest};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.verify_sequence(vec![
    HttpRequest::new().path("/some/path/one"),
    HttpRequest::new().path("/some/path/two"),
    HttpRequest::new().path("/some/path/three"),
]).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$client->verifySequence(
    HttpRequest::request()->path('/some/path/one'),
    HttpRequest::request()->path('/some/path/two'),
    HttpRequest::request()->path('/some/path/three')
);
curl -v -X PUT "http://localhost:1080/mockserver/verifySequence" -d '{
   "httpRequests":[
      {
         "path":"/some/path/one"
      },
      {
         "path":"/some/path/two"
      },
      {
         "path":"/some/path/three"
      }
   ]
}'
HttpRequest[] recordedRequests = new MockServerClient("localhost", 1080)
    .retrieveRecordedRequests(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
HttpRequest[] recordedRequests = new ClientAndServer(1080)
    .retrieveRecordedRequests(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .retrieveRecordedRequests({
    "path": "/some/path",
    "method": "POST"
  })
  .then(
    function (recordedRequests) {
      console.log(JSON.stringify(recordedRequests));
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .retrieveRecordedRequests({
      "path": "/some/path",
      "method": "POST"
    })
    .then(
      function (recordedRequests) {
        console.log(JSON.stringify(recordedRequests));
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
recorded_requests = client.retrieve_recorded_requests(
    HttpRequest(path="/some/path", method="POST")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
recorded_requests = client.retrieve_recorded_requests(
  request: HttpRequest.new(path: '/some/path', method: 'POST')
)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
recordedRequests, err := client.RetrieveRecordedRequests(
    mockserver.Request().Path("/some/path").Method("POST"),
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
var recordedRequests = client.RetrieveRecordedRequests(
    HttpRequest.Request().WithPath("/some/path").WithMethod("POST")
);
use mockserver_client::{ClientBuilder, HttpRequest};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
let recorded_requests = client.retrieve_recorded_requests(
    Some(&HttpRequest::new().path("/some/path").method("POST")),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$recordedRequests = $client->retrieveRecordedRequests(
    HttpRequest::request()->path('/some/path')->method('POST')
);
curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=REQUESTS" -d '{
    "path": "/some/path",
    "method": "POST"
}'
Expectation[] recordedExpectations = new MockServerClient("localhost", 1080)
    .retrieveRecordedExpectations(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
Expectation[] recordedExpectations = new ClientAndServer(1080)
    .retrieveRecordedExpectations(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .retrieveRecordedExpectations({
    "path": "/some/path",
    "method": "POST"
  })
  .then(
    function (recordedExpectations) {
      console.log(JSON.stringify(recordedExpectations));
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .retrieveRecordedExpectations({
      "path": "/some/path",
      "method": "POST"
    })
    .then(
      function (recordedExpectations) {
        console.log(JSON.stringify(recordedExpectations));
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
recorded_expectations = client.retrieve_recorded_expectations(
    HttpRequest(path="/some/path", method="POST")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
recorded_expectations = client.retrieve_recorded_expectations(
  request: HttpRequest.new(path: '/some/path', method: 'POST')
)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
recordedExpectations, err := client.RetrieveRecordedExpectations(
    mockserver.Request().Path("/some/path").Method("POST"),
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
var recordedExpectations = client.RetrieveRecordedExpectations(
    HttpRequest.Request().WithPath("/some/path").WithMethod("POST")
);
use mockserver_client::{ClientBuilder, HttpRequest};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
let recorded_expectations = client.retrieve_recorded_expectations(
    Some(&HttpRequest::new().path("/some/path").method("POST")),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$recordedExpectations = $client->retrieveRecordedExpectations(
    HttpRequest::request()->path('/some/path')->method('POST')
);
curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=RECORDED_EXPECTATIONS" -d '{
    "path": "/some/path",
    "method": "POST"
}'
// retrieveLogMessagesArray returns a String[] of formatted log messages;
// use retrieveLogMessages(...) for a single String containing all messages
String[] logMessages = new MockServerClient("localhost", 1080)
    .retrieveLogMessagesArray(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
// retrieveLogMessagesArray returns a String[] of formatted log messages;
// use retrieveLogMessages(...) for a single String containing all messages
String[] logMessages = new ClientAndServer(1080)
    .retrieveLogMessagesArray(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .retrieveLogMessages({
    "path": "/some/path",
    "method": "POST"
  })
  .then(
    function (logMessages) {
      // logMessages is a String[]
      console.log(logMessages);
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .retrieveLogMessages({
      "path": "/some/path",
      "method": "POST"
    })
    .then(
      function (logMessages) {
        // logMessages is a String[]
        console.log(logMessages);
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
log_messages = client.retrieve_log_messages(
    HttpRequest(path="/some/path", method="POST")
)
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
log_messages = client.retrieve_log_messages(
  request: HttpRequest.new(path: '/some/path', method: 'POST')
)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
logMessages, err := client.RetrieveLogMessages(
    mockserver.Request().Path("/some/path").Method("POST"),
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
var logMessages = client.RetrieveLogMessages(
    HttpRequest.Request().WithPath("/some/path").WithMethod("POST")
);
use mockserver_client::{ClientBuilder, HttpRequest};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
let log_messages = client.retrieve_log_messages(
    Some(&HttpRequest::new().path("/some/path").method("POST")),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$logMessages = $client->retrieveLogMessages(
    HttpRequest::request()->path('/some/path')->method('POST')
);
curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=LOGS" -d '{
    "path": "/some/path",
    "method": "POST"
}'
new MockServerClient("localhost", 1080).clear(
    request()
        .withPath("/some/path")
        .withMethod("POST")
);
new ClientAndServer(1080).clear(
    request()
        .withPath("/some/path")
        .withMethod("POST")
);
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .clear({
    'path': '/some/path'
  })
  .then(
    function () {
      console.log("cleared state that matches request matcher");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .clear({
      'path': '/some/path'
    })
    .then(
      function () {
        console.log("cleared state that matches request matcher");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
client.clear(HttpRequest(path="/some/path"))
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
client.clear(HttpRequest.new(path: '/some/path'))
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
err := client.Clear(
    mockserver.Request().Path("/some/path"),
    mockserver.ClearAll,
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.Clear(HttpRequest.Request().WithPath("/some/path"));
use mockserver_client::{ClientBuilder, HttpRequest};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.clear(
    Some(&HttpRequest::new().path("/some/path")),
    None,
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$client->clear(HttpRequest::request()->path('/some/path'));
curl -v -X PUT "http://localhost:1080/mockserver/clear" -d '{
    "path": "/some/path"
}'
new MockServerClient("localhost", 1080).clear(
    request()
        .withPath("/some/path")
        .withMethod("POST"),
    ClearType.LOG
);
new ClientAndServer(1080).clear(
    request()
        .withPath("/some/path")
        .withMethod("POST"),
    ClearType.LOG
);
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .clear({
    'path': '/some/path'
  }, 'LOG')
  .then(
    function () {
      console.log("cleared state that matches request matcher");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .clear({
      'path': '/some/path'
    }, 'LOG')
    .then(
      function () {
        console.log("cleared state that matches request matcher");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient, HttpRequest

client = MockServerClient("localhost", 1080)
client.clear(HttpRequest(path="/some/path"), clear_type="LOG")
require 'mockserver-client'
include MockServer

client = MockServer::Client.new('localhost', 1080)
client.clear(HttpRequest.new(path: '/some/path'), type: 'LOG')
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
err := client.Clear(
    mockserver.Request().Path("/some/path"),
    mockserver.ClearLog,
)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;
using MockServer.Client.Models;

using var client = new MockServerClient("localhost", 1080);
client.Clear(HttpRequest.Request().WithPath("/some/path"), type: "log");
use mockserver_client::{ClientBuilder, HttpRequest, ClearType};

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.clear(
    Some(&HttpRequest::new().path("/some/path")),
    Some(ClearType::Log),
).unwrap();
use MockServer\MockServerClient;
use MockServer\HttpRequest;

$client = new MockServerClient('localhost', 1080);
$client->clear(HttpRequest::request()->path('/some/path'), 'LOG');
curl -v -X PUT "http://localhost:1080/mockserver/clear?type=log" -d '{
    "path": "/some/path"
}'
new MockServerClient("localhost", 1080).reset();
new ClientAndServer(1080).reset();
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .reset()
  .then(
    function () {
      console.log("reset all state");
    },
    function (error) {
      console.log(error);
    }
  );
<script src="https://raw.githubusercontent.com/mock-server/mockserver-monorepo/master/mockserver-client-node/mockServerClient.js"></script>
<script>
  mockServerClient("localhost", 1080)
    .reset()
    .then(
      function () {
        console.log("reset all state");
      },
      function (error) {
        console.log(error);
      }
    );
</script>
from mockserver import MockServerClient

client = MockServerClient("localhost", 1080)
client.reset()
require 'mockserver-client'

client = MockServer::Client.new('localhost', 1080)
client.reset
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
err := client.Reset()
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;

using var client = new MockServerClient("localhost", 1080);
client.Reset();
use mockserver_client::ClientBuilder;

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
client.reset().unwrap();
use MockServer\MockServerClient;

$client = new MockServerClient('localhost', 1080);
$client->reset();
curl -v -X PUT "http://localhost:1080/mockserver/reset"
List<Integer> boundPorts = new MockServerClient("localhost", 1080).bind(
            0
        );
List<Integer> boundPorts = new ClientAndServer(1080).bind(
            0
        );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .bind([0])
  .then(
    function (boundPorts) {
      console.log(JSON.stringify(boundPorts));
    },
    function (error) {
      console.log(error);
    }
  );
from mockserver import MockServerClient

client = MockServerClient("localhost", 1080)
bound_ports = client.bind(0)
require 'mockserver-client'

client = MockServer::Client.new('localhost', 1080)
bound_ports = client.bind(0)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
boundPorts, err := client.Bind(0)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;

using var client = new MockServerClient("localhost", 1080);
var boundPorts = client.Bind(0);
use mockserver_client::ClientBuilder;

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
let bound_ports = client.bind(&[0]).unwrap();
use MockServer\MockServerClient;

$client = new MockServerClient('localhost', 1080);
$boundPorts = $client->bind(0);
curl -v -X PUT "http://localhost:1080/mockserver/bind" -d '{
    "ports": [
        0
    ]
}'
List<Integer> boundPorts = new MockServerClient("localhost", 1080).bind(
            1081, 1082
        );
List<Integer> boundPorts = new ClientAndServer(1080).bind(
            1081, 1082
        );
var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
  .bind([1081, 1082])
  .then(
    function (boundPorts) {
      console.log(JSON.stringify(boundPorts));
    },
    function (error) {
      console.log(error);
    }
  );
from mockserver import MockServerClient

client = MockServerClient("localhost", 1080)
bound_ports = client.bind(1081, 1082)
require 'mockserver-client'

client = MockServer::Client.new('localhost', 1080)
bound_ports = client.bind(1081, 1082)
import (
    "log"

    mockserver "github.com/mock-server/mockserver-monorepo/mockserver-client-go/v9"
)

client := mockserver.New("localhost", 1080)
boundPorts, err := client.Bind(1081, 1082)
if err != nil {
    log.Fatal(err)
}
using MockServer.Client;

using var client = new MockServerClient("localhost", 1080);
var boundPorts = client.Bind(1081, 1082);
use mockserver_client::ClientBuilder;

let client = ClientBuilder::new("localhost", 1080).build().unwrap();
let bound_ports = client.bind(&[1081, 1082]).unwrap();
use MockServer\MockServerClient;

$client = new MockServerClient('localhost', 1080);
$boundPorts = $client->bind(1081, 1082);
curl -v -X PUT "http://localhost:1080/mockserver/bind" -d '{
    "ports": [
        1081,
        1082
    ]
}'