# Mock server - Request body

**URL:** <https://community.postman.com/t/mock-server-request-body/74774>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [February 2, 2025, 10:26am UTC](https://community.postman.com/t/mock-server-request-body/74774 "2025-02-02T10:26:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![avigailshar](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@avigailshar](https://community.postman.com/u/avigailshar)\
**Post date:** [February 2, 2025, 10:26am UTC](https://community.postman.com/t/mock-server-request-body/74774/1 "2025-02-02T10:26:51Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Hi,

I try to create mock server that have post request with specific body.  
The request body and response are in XML format.  
My goal: To accept the response only if the request body is like I’m defined and otherwise return error.  
I’ll appreciate your help as soon as possible.

Thank a lot!
