JetBrains / http-request-in-editor-spec

HTTP Request in Editor Specification
Creative Commons Attribution 4.0 International
127 stars 12 forks source link

[propose] Ability to Set File Paths as Variables #19

Open Morten-Moeller opened 1 year ago

Morten-Moeller commented 1 year ago

Issue Summary: I would like to propose a new feature for the http-request-in-editor-spec project that would allow users to set file paths as variables within the project.

Detailed Description: The ability to set file paths as variables would provide greater flexibility and automation capabilities for managing and testing HTTP requests within the editor. Users could dynamically reference and manipulate file paths, enabling them to switch between different data files or automate the process of iterating over multiple files.

Here is an example use case to illustrate the potential benefits of this feature:

POST /
Content-Type: multipart/form-data; boundary=WebAppBoundary

--WebAppBoundary
Content-Disposition: form-data; name="file"; filename="{{file_name}}"

< {{file_path}}
--WebAppBoundary--

In this example, {{file_name}} would represent the name of the file being uploaded, and {{file_path}} would be the variable representing the path to the file on the local system. With the ability to set file paths as variables, users could easily switch between different files or automate the process of uploading multiple files.

Implementing this feature would empower users to create more dynamic and versatile HTTP requests within the editor itself, reducing the need for external tools or manual modifications.

Expected Behavior: Users should be able to define file paths as variables in their HTTP requests, allowing for dynamic referencing and manipulation of file paths. This would enable scenarios such as uploading files as form data in a multipart/form-data request, as shown in the example above.

Additional Information: I understand that implementing this feature may require significant development effort, but I believe it would greatly benefit the user community. It would not only streamline workflows but also open up new possibilities for automating testing, data-driven scenarios, and other advanced use cases.

Thank you for considering my feature request. I appreciate the time and effort your team invests in improving the project. If you have any questions or require further clarification, please don't hesitate to ask.

zinoviy23 commented 1 year ago

Hi! Thank you for the proposal! You are not alone who encounter the absence of variables in file paths. So, please vote for IDEA-239325 and IDEA-298120 in our issue tracker for the updates.