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 {
79
79
}
80
80
}
81
81
82
- func httpData( ) throws -> Data {
82
+ func httpData( jsonEncoder : JSONEncoder ) throws -> Data {
83
83
switch self {
84
84
case . binary( let data) :
85
85
return data
86
86
87
87
case . json( let json) :
88
- return try JSONEncoder ( ) . encode ( json)
88
+ return try jsonEncoder . encode ( json)
89
89
90
90
case . string( let string) :
91
91
return Data ( string. utf8)
@@ -164,7 +164,7 @@ public final class RESTClient: Sendable {
164
164
165
165
if let body {
166
166
do {
167
- request. httpBody = try body. httpData ( )
167
+ request. httpBody = try body. httpData ( jsonEncoder : self . jsonEncoder )
168
168
} catch {
169
169
throw RequestError . failedToEncodeBody ( error, self . errorContext ( requestContext: errorContext) )
170
170
}
You can’t perform that action at this time.
0 commit comments