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

Copy as Curl doesn't include the path to file if content type is multipart/form-data and adds file item to body #303

Open
Frederick-S opened this issue Jan 5, 2025 · 2 comments

Comments

@Frederick-S
Copy link

Release: v0.34.0
OS: macOS 10.15.7, Intel chip
Reproduce steps:

  1. Create a new post request
  2. Set Body to Multipart Form
  3. Add a file item to body
  4. Right click the request and select Copy as Curl
  5. The path to file is missing

Current behavior:

curl --request POST \
    --url http://localhost:8080/test \
    --header 'content-type: multipart/form-data' \
    --form file=

Expected behavior:

curl --request POST \
    --url http://localhost:8080/test \
    --header 'content-type: multipart/form-data' \
    --form file=@/path/to/file
@flawiddsouza
Copy link
Owner

Hi, this happens because restfox doesn't really store the path of the file selected from the file picker, but keeps a copy of the file within the collection. Hence it is unable to get the path required for that expected behavior. When I get some time, I will check if I can change the behavior to also keep the file path, so it can be used here.

@Frederick-S
Copy link
Author

@flawiddsouza got it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants