Creating a simple rest client due to issue described here: https://github.com/Alamofire/Alamofire/issues/641

pull/68/head
Oguzhan Gungor 7 years ago
parent 5aca3ccc20
commit 480801aece
  1. 26
      Trust/Rest/RestClient.swift

@ -0,0 +1,26 @@
//
// RestClient.swift
// Alpha-Wallet
//
// Created by Oguzhan Gungor on 3/11/18.
// Copyright © 2018 Alpha-Wallet. All rights reserved.
//
import Foundation
import Alamofire
enum RestError: Error {
case invalidResponse(String)
}
struct RestClient {
static func get(endPoint: String,
parameters: [String: AnyHashable]? = nil,
completion: @escaping (_ response: DataResponse<Any>) -> Void) {
// TODO: params
Alamofire.request(endPoint, method: .get).responseJSON { response in
completion(response)
}
}
}
Loading…
Cancel
Save