|
|
@ -315,12 +315,7 @@ public struct UserApiManager: UserDataManager {
|
|
|
|
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
|
|
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
|
|
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
|
|
|
|
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
|
|
|
|
|
|
|
|
|
|
|
|
let json: [String: String] = [
|
|
|
|
URLSession.shared.uploadTask(with: request, from: responseBet.data(using: .utf8)) { data, response, error in
|
|
|
|
"result": responseBet,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let jsonData = try? JSONSerialization.data(withJSONObject: json, options: []){
|
|
|
|
|
|
|
|
URLSession.shared.uploadTask(with: request, from: jsonData) { data, response, error in
|
|
|
|
|
|
|
|
print ("ALLIN : add response " + responseBet + " for the bet Id " + id)
|
|
|
|
print ("ALLIN : add response " + responseBet + " for the bet Id " + id)
|
|
|
|
if let httpResponse = response as? HTTPURLResponse {
|
|
|
|
if let httpResponse = response as? HTTPURLResponse {
|
|
|
|
print(httpResponse.statusCode)
|
|
|
|
print(httpResponse.statusCode)
|
|
|
@ -328,4 +323,3 @@ public struct UserApiManager: UserDataManager {
|
|
|
|
}.resume()
|
|
|
|
}.resume()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|