stubby4node icon indicating copy to clipboard operation
stubby4node copied to clipboard

How to return different responses for the same endpoint ?

Open vcamposs opened this issue 2 years ago • 2 comments

For exemple :

Endpoint: /hey/0011 hit:1 -> {"hey":"a"} hit:2 -> {"hey":"b"}

vcamposs avatar Oct 04 '23 19:10 vcamposs

Like this?

From https://github.com/mrak/stubby4node#response

The response property can also be a yaml sequence of responses that cycle as each request is made.

- request:
    url: /hey/0011
  response:
  - status: 200
    body: '{"hey":"a"}'
  - status: 200
    body: '{"hey":"b"}'

mrak avatar Oct 04 '23 20:10 mrak

oww =/ I hadn't understood. Tks mrak. I s2 s4n =))

vcamposs avatar Oct 06 '23 00:10 vcamposs