Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different HTTP response for each request #10

Open
amitguptagwl opened this issue Dec 1, 2018 · 3 comments
Open

Different HTTP response for each request #10

amitguptagwl opened this issue Dec 1, 2018 · 3 comments
Labels
enhancement good first issue small win, trivial, less complex issues. Created to encourage Open Source development help wanted

Comments

@amitguptagwl
Copy link
Member

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 ]
@amitguptagwl amitguptagwl added enhancement help wanted good first issue small win, trivial, less complex issues. Created to encourage Open Source development labels Dec 1, 2018
@fiuzaB
Copy link

fiuzaB commented Oct 1, 2019

Can I take this ?

@amitguptagwl
Copy link
Member Author

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.

@fiuzaB
Copy link

fiuzaB commented Oct 2, 2019

Ok, let me know and I'll tackle with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue small win, trivial, less complex issues. Created to encourage Open Source development help wanted
Projects
None yet
Development

No branches or pull requests

2 participants