-
Notifications
You must be signed in to change notification settings - Fork 718
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
Does this library support dry-run? #288
Comments
@ruinshe I think it would be best to add the dry run option in the Request object. Having a flag in the request to drop the outgoing request. If you're interested, you can submit PR otherwise I will take it up later on 😄 |
@jeevatkm Maybe I don't have much time in current stage, for free take it up.. Besides, I will take a look if I have time later. |
@ruinshe Thanks, no worries. I will take it up later. |
I think we have |
@lrita has a point. Technically custom transport could be used with user code to achieve this. For now I will put this in the backlog. |
Thank all for the suggestion, although the solution seems to be same as what I did, it will make th code more clearer. I switched my code using customized transport for request rewritten. |
@ruinshe Do you mind sharing the code what you did? so that we can evaluate to include in the resty lib or not? If it's trivial, we can add it as resty documentation. What do you think? |
I think refine the document helps, because in the transport we can do everything (even if the user only cares about the headers not whole request, etc). |
I'm using this library for our internal project's command line tools, and I met a problem that we need a customized flag
--dry-run
to print all useful information but the request will not really sent.Currently I added a util package to print the client object directly in
client.OnBeforeRequest
if the dry run mode is enabled then let the function return notnil
error, and it seems not a good solution.Do you have any suggestion to print the request information and stop sending API in this case?
Currently my solution:
The text was updated successfully, but these errors were encountered: