# Mock Server returning invalid results

**URL:** <https://community.postman.com/t/mock-server-returning-invalid-results/2804>\
**Category:** Help Hub\
**Created:** [September 27, 2018, 12:56am UTC](https://community.postman.com/t/mock-server-returning-invalid-results/2804 "2018-09-27T00:56:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkevinburton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/rkevinburton/32/273_2.png) [@rkevinburton](https://community.postman.com/u/rkevinburton)\
**Post date:** [September 27, 2018, 12:56am UTC](https://community.postman.com/t/mock-server-returning-invalid-results/2804/1 "2018-09-27T00:56:45Z")

</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 have a collection that for one of the requests I have created a number of examples. One of the examples uses a URL like:

[http://cpp.testent.gartner.com/api/GenericDataHandler/ComponentData/?componentName=HlcItemStatusDates&amp;operation=GetData&amp;passedInData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=](http://cpp.testent.gartner.com/api/GenericDataHandler/ComponentData/?componentName=HlcItemStatusDates&amp;operation=GetData&amp;passedInData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=)

I set up a Mock server for this collection and then add a call to the mock server

[https://56a6042e-2be2-4eb1-b246-e9609a9e7c91.mock.pstmn.io/api/GenericDataHandler/ComponentData/?ComponentName=HlcItemStatusDates&amp;operation=GetData&amp;passedData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=](https://56a6042e-2be2-4eb1-b246-e9609a9e7c91.mock.pstmn.io/api/GenericDataHandler/ComponentData/?ComponentName=HlcItemStatusDates&amp;operation=GetData&amp;passedData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=)

The problem I am seeing is that the response to the mock request does not match the example response. And yes there is only one request in the examples with the URL api/GenericDataHandler/ComponentData/?ComponentName=HlcItemStatusDates&operation=GetData&passedData=ID=0,ItemId=500062,ItemStatusId=,ItemStatusDateTypeId=,DateValue=,EmployeeId=

What am I doing wrong? Or what assumptions am I making that I shouldn’t?

Thank you.

---

<div class="post-metadata">

**Author:** ![pratik](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pratik/32/224_2.png) [@pratik](https://community.postman.com/u/pratik)\
**Post date:** [September 28, 2018, 8:08am UTC](https://community.postman.com/t/mock-server-returning-invalid-results/2804/2 "2018-09-28T08:08:31Z")

</div>

@rkevinburton - Current Mock servers do not look at the query param part of your URL. Which means if you have multiple examples responses for the path `api/GenericDataHandler/ComponentData/` the response returned by the mock server will be the first one that matches that path.

Can you confirm if this is the cause for invalid results?
