File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,13 @@ public final class RESTClient: Sendable {
7979 }
8080 }
8181
82- func httpData( ) throws -> Data {
82+ func httpData( jsonEncoder : JSONEncoder ) throws -> Data {
8383 switch self {
8484 case . binary( let data) :
8585 return data
8686
8787 case . json( let json) :
88- return try JSONEncoder ( ) . encode ( json)
88+ return try jsonEncoder . encode ( json)
8989
9090 case . string( let string) :
9191 return Data ( string. utf8)
@@ -164,7 +164,7 @@ public final class RESTClient: Sendable {
164164
165165 if let body {
166166 do {
167- request. httpBody = try body. httpData ( )
167+ request. httpBody = try body. httpData ( jsonEncoder : self . jsonEncoder )
168168 } catch {
169169 throw RequestError . failedToEncodeBody ( error, self . errorContext ( requestContext: errorContext) )
170170 }
You can’t perform that action at this time.
0 commit comments