Closed MaicolBen closed 7 years ago
Add: JSONEncoding.default
in Alamofire.request(requestUrl, method: method, parameters: params, encoding: JSONEncoding.default, headers: header)
Replace fileprivate class func getHeader() -> [String: String]?
:
fileprivate class func getHeader() -> [String: String]? {
if let session = SessionDataManager.getSessionObject() {
return [
HTTPHeader.uid.rawValue: session.uid ?? "",
HTTPHeader.client.rawValue: session.client ?? "",
HTTPHeader.token.rawValue: session.accessToken ?? "",
"Accept": "application/json",
"Content-Type": "application/json"
]
}
return ["Accept": "application/json",
"Content-Type": "application/json"]
}
@mjurfest X-USER-TOKEN
is no longer valid for the new rails 5 api-base
. We should add only the
"Accept": "application/json",
"Content-Type": "application/json"
part to the current header implementation in the swift-base
Previous post edited
Now it will be needed after https://github.com/toptier/rails5_api_base/pull/46 is merged