ITADN

Multipart Files without requiring the field name

#1878OpenTekExplorer 创建于 2026-02-11
type-enhancementpackage:http
T
TekExplorercommented
I am currently working on a generator that uses the http package not unlike retrofit, and i find myself in a rather unpleasant position of realizing that MultipartFile leaks the field name to what i consider the wrong place. I could create my own file part class, but I think that the current api is kinda inconsistent, as the field names should only be relevant to the request, not the file contents/source. I would suggest either combining both `fields` and `files` into `Map<String, Object /*String | MultipartFile*/> fields` or changing `fields` to be `Map<String, MultipartFile> fields` This would be a breaking change, but i consider it better than what we have now, which i consider bad practice. Especially since `MultipartFile` doesnt actually use the field name anywhere - its just a carrier, which could be better served as mentioned above.
0 条评论