# Mock server always returning "mockRequestNotFoundError"

**URL:** <https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835>\
**Category:** Help Hub\
**Tags:** mocks, help, mockservers, mock-server, mock\
**Created:** [July 9, 2024, 9:53am UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835 "2024-07-09T09:53:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![epablom](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/epablom/32/29268_2.png) [@epablom](https://community.postman.com/u/epablom)\
**Post date:** [July 9, 2024, 9:53am UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835/1 "2024-07-09T09:53:08Z")

</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).

I created a new collection with a single request to learn how to use _Postman_ mock servers and, while I managed to successfully make it private, return different examples for a single route depending on query parameters… Everything broke down when attempting to return an example of a request that has a JSON body.

All I’m receiving now from the mock server is the following error:

```auto
{
        "error": {
        "name": "mockRequestNotFoundError",
        "message": "Double check your method and the request path and try again.",
        "header": "No matching requests"
    }
}

```

**Additional data**

- Mock server configuration:  

- GET request:  

- Example:

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 9, 2024, 1:39pm UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835/2 "2024-07-09T13:39:42Z")

</div>

Hey @epablom 👋

Welcome to the Postman Community! :postman:

It’s a little difficult to see what’s going on with the cropped images.

Do you have more examples in the request that could be returned?

Is it returning the correct example of you were to use the `x-mock-response-name` header and the example name as the value?

If you could provide more details, it will help to narrow down what the issue might be here. 🙏

---

<div class="post-metadata">

**Author:** ![epablom](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/epablom/32/29268_2.png) [@epablom](https://community.postman.com/u/epablom)\
**Post date:** [July 9, 2024, 1:55pm UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835/3 "2024-07-09T13:55:35Z")

</div>

There aren’t any other examples for the query and this one is the only request in the collection.

Using the `x-mock-response-name` header does, indeed, work. Although it’d be nice to know if there’s another solution to the problem, since I’m aiming to call a similar mock server with the same problem (and a fairly larger collection and set of examples) from an external app in the near future.  
  
  
Let me know whatever other info would be useful (or what other format instead of the cropped images would). :))

---

<div class="post-metadata">

**Author:** ![epablom](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/epablom/32/29268_2.png) [@epablom](https://community.postman.com/u/epablom)\
**Post date:** [July 31, 2024, 11:31am UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835/4 "2024-07-31T11:31:59Z")

</div>

Finally found the problem.

The thing was that the API I was given wasn’t following REST architecture standards and good practices.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [August 4, 2024, 11:19pm UTC](https://community.postman.com/t/mock-server-always-returning-mockrequestnotfounderror/63835/6 "2024-08-04T23:19:37Z")

</div>

Closed on August 4, 2024, 11:19pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
