Skip to content

v1.0.9 - Custom Content-Type Header Support

Choose a tag to compare

@TheBIMsider TheBIMsider released this 01 Dec 19:23
· 16 commits to main since this release

Fixed

  • Custom Content-Type header handling in POST, PUT, and PATCH operations
  • When using RequestNodes.AddHeader to set custom Content-Type (e.g., application/merge-patch+json), the value is now properly applied instead of being overridden by default application/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/json when no custom header is set

Files Changed

  • HttpRequest.cs - Enhanced ToHttpRequestMessage() method
  • ExecuteNodes.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.