-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for a json file as the request body #8
Comments
Hello! I have started working on this issue and I have currently implemented all the logic necessary to use a file as the body of a request. The only thing I am wondering about is what should the variable containing the path to the request body be called in the Currently, I have it working with this: [endpoints.test-post]
route = "/test-post"
method = "post"
bodyPath = "/some/path/to/request_body_file" The I have made a pull request containing my work so far if you would like to take a look at it. P.S: Sorry for not claiming this issue earlier. I forgot to make a comment on the Issue tracker before starting. |
Hi @sehnsucht13! First of all, thank you for contributing to Zum! To be consistent with the rest of the API, I think that it might be a good idea to declare that a file will be used from the config file and then pass the file path from the [endpoints.example]
route = "/endpoint"
body = "json" That way, you could call: zum example ./requests/body.json This way, we avoid letting the user define an ignored [endpoints.example]
route = "/endpoint"
body = "toml" That way, you could call: zum example ./requests/body.toml What do you think? |
Hi! I like the idea of using the |
I have updated my pull request with a new commit. Now, Please let me know if there are any issues. I am looking forward to any feedback. |
It would be nice to be able to just specify a file name and then have
zum
open that file and use its contents as a request body.The text was updated successfully, but these errors were encountered: