# How to send push notifications

**URL:** <https://community.postman.com/t/how-to-send-push-notifications/3738>\
**Category:** Help Hub\
**Tags:** mocks, variables, scripts\
**Created:** [January 7, 2019, 11:45am UTC](https://community.postman.com/t/how-to-send-push-notifications/3738 "2019-01-07T11:45:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mark](https://community.postman.com/u/mark)\
**Post date:** [January 7, 2019, 11:45am UTC](https://community.postman.com/t/how-to-send-push-notifications/3738/1 "2019-01-07T11:45:59Z")

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

How can I configure the mock server to send push notifications or multiple responses (with associated headers) for a single request?

For example: htp://request?set=a,b,c → I get the response of ‘ok’ as well as three responses corresponding to ‘a=1’, ‘b=2’, ‘c=3’.

Alternatively we can have the client ‘poll’ periodically. In this case, how can I send dynamic responses depending on environment variables, with a piece of script?

Example: htp://request?set=a,b,c → Response ‘ok’.  
htp://request?poll → Response ‘a=1’  
htp://request?poll → Response ‘b=2’  
htp://request?poll → Response ‘c=3’  
htp://request?poll → Response ‘’
