Skip to content

Commit

Permalink
feature: add content-type on JSONClient
Browse files Browse the repository at this point in the history
  • Loading branch information
0xWOF committed Feb 13, 2024
1 parent 7c774e0 commit a6900a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Network/Implement/Client/JSONClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ extension JSONClient {
timeout: Interval? = nil,
optionBlock: (inout URLRequest) -> Void = { _ in }
) -> Promise<ClientResult<JSON>, Error> {
let header = header.merging([
"Content-Type": "application/json"
]) { _, new in new }

var bodyData: Data? = nil
if let body {
guard let body = try? body.datafy() else {
Expand Down

0 comments on commit a6900a9

Please sign in to comment.