Stubmatic
Stubmatic copied to clipboard
Different HTTP response for each request
Currently, a user can create the mapping to serve the response from random files or in a round-robin fashion. (wiki)
- request:
url: /stubs/employee/([0-9]+)
response:
strategy: random
files: ["<% url.1 %>.xml","file2.xml","file3.xml"]
Or
- request:
url: /stubs/employee/([0-9]+)
response:
strategy: random
files: ["<% url.1 %>.xml","file2.xml",{"name":"file3.xml","status":500}]
But what if a user wants the same behavior but without any response in the body? He can create an empty file and do a hack like this;
- request:
url: /stubs/employee/([0-9]+)
response:
strategy: random
files: [{"name":"empty","status":500}, {"name":"empty","status":503}]
We're looking for some meaningful mapping
- request:
url: /stubs/employee/([0-9]+)
response:
strategy: random
status: [ 500, 503 ]
Can I take this ?
Thanks for showing your interest @fiuzaB . But I have recently done some big changes to the library. Let me push them and then probably your pick this.
Ok, let me know and I'll tackle with it.