--- title: Creating Expectations description: Define request matchers and response actions in MockServer using the Java, JavaScript, Python, Ruby, Go, .NET, Rust, or PHP client, REST API, or JSON files. layout: page pageOrder: 1 section: 'Creating Mocks' subsection: true sitemap: priority: 0.8 changefreq: 'monthly' lastmod: 2026-06-10T00:00:00+00:00 ---

This page contains over 100 detailed code examples covering every matcher and response action across 8 client languages — Java, JavaScript, Python, Ruby, Go, .NET, Rust, and PHP — plus the equivalent REST API / JSON. Use the accordion tabs in each example to switch to your language.

{% include_subpage _includes/creating_expectations.html %}  

Next Steps