diff --git a/CHANGELOG.md b/CHANGELOG.md index 0765511..3e068cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +## [1.3.0] - 2023-10-12 + +### Added + +- Added an overload method to set binary content with their content type. + ## [1.2.3] - 2023-10-05 ### Added diff --git a/request_information.go b/request_information.go index c5df2c1..10b8ce7 100644 --- a/request_information.go +++ b/request_information.go @@ -130,10 +130,16 @@ const contentTypeHeader = "Content-Type" const binaryContentType = "application/octet-steam" // SetStreamContent sets the request body to a binary stream. +// Deprecated: Use SetStreamContentAndContentType instead. func (request *RequestInformation) SetStreamContent(content []byte) { + request.SetStreamContentAndContentType(content, binaryContentType) +} + +// SetStreamContentAndContentType sets the request body to a binary stream with the specified content type. +func (request *RequestInformation) SetStreamContentAndContentType(content []byte, contentType string) { request.Content = content if request.Headers != nil { - request.Headers.Add(contentTypeHeader, binaryContentType) + request.Headers.Add(contentTypeHeader, contentType) } }