proxyman-windows-linux
proxyman-windows-linux copied to clipboard
Multiple Part Forms
Description
- Sample File:
Acceptance Criteria
- If the request is a multipart request (Check the Content-Type header: If it starts with
multipart/form-data) - Show the Multipart tab on the Request Tab (Don't implement on the Response Tab)
- Display Multiple part as a table view
-
Make sure the Body Tab renders correctly
-
Able to export the FILE to Desktop -> Export with filename + extension -> Able to open it without any error.
Logic
- Implement the class
MultipartServiceto handle the parser - Use this lib: https://www.npmjs.com/package/parse-multipart-data
- Write Unit Test to try to parse a given Body (Multipart includes text, and Binary File) -> Get data correctly.
How to test
- Use Insomnia or Postman to make a Multipart request
- Use multiple Texts and Files for testing
- Make sure Proxyman can show the Multipart correctly.
Update requirement
- Show this view if the total body is over 5Mb. If it's < 5Mb, show the Multipart view as usual
- Verify that if body > 5 Mb, we don't process the Multipart data, because it can cause performance issues (app hangs, freeze, ...)
- Use a
Saveand "Show anyway" button. Remove the "Open With" button. Save: Select a folder -> Proxyman will exportALLparts to a selected folder, each part should have the name by format:
- If this part has the
filenamecolumn -> Use this filename - If this part doesn't have the
filename-> Use generic name:Part_${index}
Show anywaywill show the Multipart view as usual. This selection doesn't persist, it will reset to FALSE if we select new flow.
- This new requirement will fix this issue: https://github.com/ProxymanApp/Proxyman/issues/1828
How to test with large data
- Make a multipart with Insomnia / Postman with 3 parts: 2 first parts are an Video/Image ~20Mb, and the last part is a JSON string.
- Open it on Proxyman -> Verify the "Body over 5Mb ..." is displayed ✅ -> Verify we don't proceed the Multipart Data.
- Click on the "Save" button -> Select the folder:
testin theDesktop. Verify We have 3 files are exported ✅ (2 files are image/video, can open it, and the last file is a JSON text) - Click on the
Show anywaybutton -> Show the Multipart Preview as usual
New Requirement 2
- Multipart requests should work with cURL. Check out the Slack Post how to implement.
- Original ticket: https://github.com/ProxymanApp/Proxyman/issues/1018