We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get this response from the server when using OAuth with .post request
{ code = "woocommerce_rest_authentication_error"; data = { status = 401; }; message = "Invalid signature - provided signature does not match."; }
public func fetchObjectWithOAuth(type: APIMethodType, params: KBHTTPParameters? = nil, handler: @escaping (T?, _ error: AlertMessage?)->()) where T: Codable {
session = SessionManager( configuration: .default ) session?.adapter = oauthswift.requestAdapter self.session.request(type.url, method: type.httpMethod, parameters: params, encoding: URLEncoding.default,headers: type.headers).responseJSON { data in switch data.result { case .success(let value): print("The value is : \n\(value)") let decoder = JSONDecoder() guard let jsonData = data.data else { handler(nil, AlertMessage(title: NetworkingStrings.baseErrorTitle.localized, body: NetworkingStrings.baseErrorMessage.localized)) break } do { let result = try decoder.decode(T.self, from: jsonData) handler(result, nil) } catch { print("JSON SERIALIZATION error!: \(error)") handler(nil, AlertMessage.dataParseErrorAlertMessage) } break case .failure(let error): //handler(nil, self.parseApiError(data: data.data)) handler(nil, AlertMessage(title: NetworkingStrings.baseErrorTitle.localized, body: error.localizedDescription)) break } } }
Note: It works for other request types (.GET , .PUT ,.DELETE)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I get this response from the server when using OAuth with .post request
{
code = "woocommerce_rest_authentication_error";
data = {
status = 401;
};
message = "Invalid signature - provided signature does not match.";
}
public func fetchObjectWithOAuth(type: APIMethodType, params: KBHTTPParameters? = nil, handler: @escaping (T?, _ error: AlertMessage?)->()) where T: Codable {
Note: It works for other request types (.GET , .PUT ,.DELETE)
The text was updated successfully, but these errors were encountered: