Open ash-eng-spin opened 4 months ago
Hi,
We have the same problem indeed especially for parameters in JSON format. I sent a PR so that it detects when the parameter is in JSON format, and add Content-Type: application/json in this case.
We are facing the same issue. This is the single feature missing so we can fully migrate to Bruno. We need to send a file and a json in the same request. It seems like @busy-panda 's PR could do the trick while we wait for a feature as suggested by @ash-eng-spin .
We had the same issue. Hope the change provided by @busy-panda will be approved quickly.
Sorry I closed my PR because I prefer to fully implement as suggested by @ash-eng-spin, so I will add a column "Content-Type".
That will probably take more time.
The enhancement is fully implemented and the PR was created: https://github.com/usebruno/bruno/pull/2121
I had a case where I needed to send in a multi-part form a file item and a JSON item. At first, I provided the JSON as a "Param" item. No content-type was automatically set for this form entry, so the request was rejected by my server. Work-around: I passed the JSON as a JSON file and Bruno automatically set the content-type, so my server accepted the request. I agree that being able to manually define the content-type of each item would be better.
I had a case where I needed to send in a multi-part form a file item and a JSON item. At first, I provided the JSON as a "Param" item. No content-type was automatically set for this form entry, so the request was rejected by my server. Work-around: I passed the JSON as a JSON file and Bruno automatically set the content-type, so my server accepted the request. I agree that being able to manually define the content-type of each item would be better.
Thank you for sharing. I just tested and it worked for me as well.
Good option until we can manually/individually set the content-type.
When setting up a multipart request, Bruno automatically selects the content-type of the file part. The auto-assigned content-type is not always the desired content-type of the API spec, therefore our request will always result in a 400 Bad Request, because the content-type is wrong.
Please allow a way for the user to set the content type for a multi-part request part. File or text
Text/Param: user should be able to set because this could be blank, application/json, application/xml, text/plain or many other things. Files: user should be able to set because this could be blank, application/pdf, application/octet-stream, application/vnd.ms-excel, text/csv or many other things.
Example: Multipart Form Data: PDF file content-type automatically set. No manual way for user to set content-type for a file. Why is this a problem: API spec for the pdf file wants "application/octet-stream" for the content-type. Bruno automatically sets the content-type to "application/pdf". No way to manually set the content-type. Results in 400 bad request because content-type does not match API spec and there is no way to change in Bruno.
This appears to align with your plans to update the Bru Lang Schema https://github.com/usebruno/bruno/issues/1502 but I want to make sure the user can set the content-type in the UI for params and files.
Versions
v1.9.0
Steps to reproduce 1
Steps to reproduce 2
For reference this is how it works in Postman:![image](https://github.com/usebruno/bruno/assets/131696171/2eb231ad-7de5-40e8-a5fa-31b01d2a3b24)