[fit] Add multipart/form-data serialization support for HTTP client#331
Merged
CodeCasterX merged 1 commit into3.5.xfrom Oct 4, 2025
Merged
[fit] Add multipart/form-data serialization support for HTTP client#331CodeCasterX merged 1 commit into3.5.xfrom
CodeCasterX merged 1 commit into3.5.xfrom
Conversation
…315) ## Summary - Implement multipart/form-data request serialization for HTTP client - Support both text fields and file uploads in multipart requests - Auto-generate boundary with format: FitFormBoundary-{uuid} - Maintain backward compatibility with existing deserialization ## Changes 1. Add Entity.resolvedParameters() method for Content-Type parameters 2. Implement MultiPartEntitySerializer.serializeEntity() method 3. Auto-generate and inject boundary parameter in DefaultPartitionedEntity 4. Merge entity parameters with base parameters in AbstractHttpMessage 5. Add comprehensive test cases for multipart serialization ## Test Results - All 237 tests passed - New tests cover: empty entities, text fields, file fields, mixed fields Fixes #315 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
实现 HTTP 客户端的 multipart/form-data 请求序列化功能,支持文件上传和表单数据提交。
Changes
核心功能
Entity接口中添加resolvedParameters()方法,允许实体提供 Content-Type 额外参数MultiPartEntitySerializer.serializeEntity()方法,支持 multipart 格式序列化DefaultPartitionedEntity自动生成 boundary(格式:FitFormBoundary-{uuid})AbstractHttpMessage自动合并实体参数到 Content-Type header技术细节
UuidUtils.randomUuidString()生成唯一标识示例用法
Test Results
Breaking Changes
无破坏性变更。新增的
Entity.resolvedParameters()方法在AbstractEntity中提供了默认实现。Related Issue
Fixes #315
🤖 Generated with Claude Code