Conversation
…validation Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/0ade851e-6448-4ede-ada7-07339138773f Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
… tip Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/97b1610c-b0aa-4ea2-b3d9-ce785756632c Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/23cde3f2-1f6c-4b38-aa79-c32a96ac4407 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
…g-document fix: add missing load-testing.md and markdown link check workflow
Add zh-CN translations for all 15 documentation files in docs/articles/: - README.zh.md - installation.zh.md - quick-start.zh.md - basic-usage.zh.md - http-requests.zh.md - request-data-types.zh.md - authentication.zh.md - file-execution.zh.md - api-test-collections.zh.md - load-testing.zh.md - docker-usage.zh.md - ci-cd-integration.zh.md - debugging.zh.md - examples/common-use-cases.zh.md - reference/command-line-options.zh.md Translation conventions: - Code blocks, commands, file names, technical terms, URLs remain in English - Section headings translated to natural Simplified Chinese - Added '> 📖 [查看中文文档](filename.zh.md)' note at top of each English file - Added '([中文](README.zh.md))' suffix to docs/articles/README.md heading - Added 🇨🇳 Chinese docs row to Documentation table in root README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/d34be4e5-db2a-4ca7-9314-c02b3466c79b Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/430f4ecf-f815-4890-a95c-3f3923029cac Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/f35e1135-4a1a-4560-a242-365f029f3057 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
…-links Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/505570e9-db63-4014-a6f8-395d72e3e389 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
…se-document docs: add Simplified Chinese translations for all documentation articles
Update NuGet Packages
Update NuGet Packages
Update NuGet Packages
Update NuGet Packages
testing dotnet-install musl binary
Update NuGet Packages
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Update NuGet Packages
Update NuGet Packages
Update NuGet Packages
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/47ef4697-57b1-4707-bb86-dbbcbf1e23e6 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/9068a33f-3a1b-499e-996e-7e16ebeac75b Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/5102a8f8-ebf8-4dd3-91ab-754c98bddec1 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/5102a8f8-ebf8-4dd3-91ab-754c98bddec1 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/5102a8f8-ebf8-4dd3-91ab-754c98bddec1 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WeihanLi/dotnet-httpie/sessions/5102a8f8-ebf8-4dd3-91ab-754c98bddec1 Co-authored-by: WeihanLi <7604648+WeihanLi@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…eature feat: implement multipart/form-data file upload via --multipart flag
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates dotnet-httpie for the 0.17.1 preview line by adding first-class multipart/form-data support (including file uploads) and introducing a DocFX documentation site with extensive Simplified Chinese documentation and link-checking workflows.
Changes:
- Add
--multipartflag support, multipart request modeling, and multipart request mapping (including file uploads). - Add unit tests covering multipart parsing/mapping behavior.
- Add DocFX documentation site scaffolding + Chinese documentation set, update READMEs, and add CI workflows for docs and markdown link checking; bump package versions and patch version.
Reviewed changes
Copilot reviewed 52 out of 53 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/HTTPie.UnitTest/Middleware/MultipartUploadMiddlewareTest.cs | Adds unit tests for multipart parsing behavior in RequestDataMiddleware. |
| tests/HTTPie.UnitTest/Implement/RequestMapperTest.cs | Adds unit tests verifying multipart HttpRequestMessage construction. |
| src/HTTPie/Utilities/Constants.cs | Introduces IsMultipartContentType flag constant. |
| src/HTTPie/Models/MultipartRequestPart.cs | Adds multipart part model records (text/file). |
| src/HTTPie/Models/HttpRequestModel.cs | Extends request model with multipart parts collections. |
| src/HTTPie/Middleware/RequestDataMiddleware.cs | Adds --multipart option and parsing logic for multipart text/file items. |
| src/HTTPie/Implement/RequestMapper.cs | Maps multipart request models to MultipartFormDataContent, including file streams and MIME types. |
| README.zh.md | Adds a full Simplified Chinese README. |
| README.md | Links to Chinese documentation and adds a docs index entry. |
| docs/toc.yml | Adds DocFX top-level TOC for the documentation site. |
| docs/ReleaseNotes.zh.md | Adds Simplified Chinese release notes page. |
| docs/ReleaseNotes.md | Links to the Chinese release notes page. |
| docs/index.md | Adds DocFX landing page. |
| docs/docfx.json | Adds DocFX build configuration. |
| docs/articles/toc.yml | Adds DocFX articles TOC structure. |
| docs/articles/request-data-types.zh.md | Adds Simplified Chinese “Request Data Types” article (includes multipart docs). |
| docs/articles/request-data-types.md | Links to Chinese version and trims outdated references. |
| docs/articles/reference/toc.yml | Adds reference-section TOC. |
| docs/articles/reference/command-line-options.zh.md | Adds Simplified Chinese CLI options reference. |
| docs/articles/reference/command-line-options.md | Links to Chinese version. |
| docs/articles/README.zh.md | Adds Simplified Chinese docs index. |
| docs/articles/README.md | Adds Chinese cross-link and simplifies docs index links. |
| docs/articles/quick-start.zh.md | Adds Simplified Chinese quick start. |
| docs/articles/quick-start.md | Links to Chinese version. |
| docs/articles/load-testing.zh.md | Adds Simplified Chinese load testing doc. |
| docs/articles/load-testing.md | Adds English load testing doc (with Chinese cross-link). |
| docs/articles/installation.zh.md | Adds Simplified Chinese installation guide. |
| docs/articles/installation.md | Links to Chinese version. |
| docs/articles/http-requests.zh.md | Adds Simplified Chinese HTTP requests guide. |
| docs/articles/http-requests.md | Links to Chinese version and trims outdated references. |
| docs/articles/file-execution.zh.md | Adds Simplified Chinese file execution guide. |
| docs/articles/file-execution.md | Links to Chinese version and removes sections no longer documented. |
| docs/articles/examples/toc.yml | Adds examples-section TOC. |
| docs/articles/examples/common-use-cases.zh.md | Adds Simplified Chinese common use cases guide. |
| docs/articles/examples/common-use-cases.md | Links to Chinese version and trims outdated references. |
| docs/articles/docker-usage.zh.md | Adds Simplified Chinese Docker usage guide. |
| docs/articles/docker-usage.md | Links to Chinese version and trims outdated references. |
| docs/articles/debugging.zh.md | Adds Simplified Chinese debugging guide. |
| docs/articles/debugging.md | Links to Chinese version and trims outdated references. |
| docs/articles/ci-cd-integration.zh.md | Adds Simplified Chinese CI/CD integration guide. |
| docs/articles/ci-cd-integration.md | Links to Chinese version and fixes relative links in “Next steps”. |
| docs/articles/basic-usage.zh.md | Adds Simplified Chinese basic usage guide. |
| docs/articles/basic-usage.md | Links to Chinese version. |
| docs/articles/authentication.zh.md | Adds Simplified Chinese authentication guide. |
| docs/articles/authentication.md | Links to Chinese version and trims outdated references. |
| docs/articles/api-test-collections.zh.md | Adds Simplified Chinese API test collections guide. |
| docs/articles/api-test-collections.md | Links to Chinese version. |
| Directory.Packages.props | Updates central package versions (e.g., System.CommandLine, JsonSchema.Net, coverlet, etc.). |
| build/version.props | Bumps patch version to 0.17.1. |
| build.sh | Adjusts dnx invocation argument order. |
| .gitignore | Ignores generated DocFX output (docs/_site/). |
| .github/workflows/markdown-links.yml | Adds a GitHub Actions workflow to validate markdown links. |
| .github/workflows/docfx.yml | Adds a GitHub Actions workflow to build (and on non-PR events, deploy) DocFX docs. |
Comment on lines
+54
to
+63
| // Parse file upload items: fieldName@/path/to/file | ||
| requestModel.FileUploads = requestModel.RequestItems | ||
| .Select(ParseMultipartFileUpload) | ||
| .OfType<FileUploadPart>() | ||
| .ToList(); | ||
|
|
||
| requestModel.MultipartTextParts = requestModel.RequestItems | ||
| .Select(ParseMultipartTextPart) | ||
| .OfType<MultipartTextPart>() | ||
| .ToList(); |
Comment on lines
+14
to
16
| public async Task<HttpRequestMessage> ToRequestMessage(HttpContext httpContext) | ||
| { | ||
| var requestModel = httpContext.Request; |
Comment on lines
+28
to
+54
| var isMultipart = httpContext.GetFlag(Constants.FlagNames.IsMultipartContentType); | ||
| if (isMultipart) | ||
| { | ||
| var multipartContent = new MultipartFormDataContent(); | ||
|
|
||
| foreach (var multipartTextPart in requestModel.MultipartTextParts) | ||
| { | ||
| multipartContent.Add(new StringContent(multipartTextPart.Value), multipartTextPart.FieldName); | ||
| } | ||
|
|
||
| // Add file parts | ||
| foreach (var fileUpload in requestModel.FileUploads) | ||
| { | ||
| var fileContent = CreateMultipartFileContent(fileUpload); | ||
| try | ||
| { | ||
| multipartContent.Add(fileContent, fileUpload.FieldName, Path.GetFileName(fileUpload.FilePath)); | ||
| } | ||
| catch | ||
| { | ||
| fileContent.Dispose(); | ||
| throw; | ||
| } | ||
| } | ||
|
|
||
| request.Content = multipartContent; | ||
| } |
Comment on lines
+4
to
+8
| namespace HTTPie.Models; | ||
|
|
||
| public sealed record MultipartTextPart(string FieldName, string Value); | ||
|
|
||
| public sealed record FileUploadPart(string FieldName, string FilePath); |
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.
No description provided.