Skip to content

Commit ff768b2

Browse files
committed
Only encode body if value is present.
1 parent fb7d9c2 commit ff768b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/ComposableArchitecturePattern/Server+API.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ public extension ServerAPI {
7474
}
7575
}
7676
request.httpMethod = httpMethod.rawValue
77-
request.httpBody = try self._encodedData(httpBody)
77+
if let httpBody {
78+
request.httpBody = try self._encodedData(httpBody)
79+
} else if let body {
80+
request.httpBody = try self._encodedData(body)
81+
}
7882

7983
return request
8084
}

0 commit comments

Comments
 (0)