v1.0.9 - Custom Content-Type Header Support
Fixed
- Custom Content-Type header handling in POST, PUT, and PATCH operations
- When using
RequestNodes.AddHeaderto set custom Content-Type (e.g.,application/merge-patch+json), the value is now properly applied instead of being overridden by defaultapplication/json - Enables RFC 7396 Merge Patch and other specialized HTTP operations requiring specific content-types
Technical Details
- Modified HttpRequest.ToHttpRequestMessage() to recreate StringContent with custom Content-Type when specified
- Updated ExecuteNodes POST/PUT/PATCH methods to handle custom Content-Type from HttpRequest objects
- Maintains backward compatibility - defaults to
application/jsonwhen no custom header is set
Files Changed
HttpRequest.cs- Enhanced ToHttpRequestMessage() methodExecuteNodes.cs- Updated content handling in POST, PUT, PATCH methods
⚡ Migration
No changes required for existing workflows. This fix only applies when you explicitly set a custom Content-Type header via AddHeader. All existing code continues to work with default application/json behavior.
🙏 Credit
Thanks to the community member (Robert Manna) who reported the 415 Unsupported Media Type issue with specialized PATCH operations. This fix expands DynaFetch's compatibility with modern REST API patterns.