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

Feature: set curl opts globally/per request #435

Closed
1 task done
sheimer opened this issue Sep 2, 2024 · 3 comments
Closed
1 task done

Feature: set curl opts globally/per request #435

sheimer opened this issue Sep 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@sheimer
Copy link

sheimer commented Sep 2, 2024

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

I have a route which sends a csv file with content-encoding gzip.

To be able to see the result in neovim, I have to set the --compressed arg on the curl command. I found no way to do so but changing the args in lua/rest-nvim/client/curl/cli.lua.

Maybe there is a way to allow args to be passed to curl in general? Or set --compressed, if Accept-Encoding header is set and contains gzip?

@sheimer sheimer added the enhancement New feature or request label Sep 2, 2024
@boltlessengineer
Copy link
Contributor

I’m thinking of providing meta field for rest.Request type.
So users can make User RestRequestPre autocommand to update the request metadata before running a request
and clients like curl can use that metadata on request.

Introducing additional document comment (e.g. # @curl-args --compressed) might make things easier, but I’m bit skeptical to introduce too much new specs on top of other plugins from intellij/vscode)

Adding --compressed argument automatically based on header type sounds like a good idea.

Would this fit your needs?
Also please tell me if you are willing to make a PR. If not, I will do it but it might take some time due to personal schedules.

@sheimer
Copy link
Author

sheimer commented Sep 2, 2024

I will try if I can do a PR...time might be a problem, and maybe my capabilities as well ^^ We will see :)

@boltlessengineer
Copy link
Contributor

#439 is merged now. manually closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants