     }
 }
 
-class TapglueURLConvertible: URLRequestConvertible {
-    var request: URLRequest
-    init(request: URLRequest) {
-        self.request = request
-    }
-    
-    /// Returns a URL request or throws if an `Error` was encountered.
-    ///
-    /// - throws: An `Error` if the underlying `URLRequest` is `nil`.
-    ///
-    /// - returns: A URL request.
-    public func asURLRequest() throws -> URLRequest {
-        return request as URLRequest
-    }
-}
-
 enum Method: String {
     case get = "get", post = "post", put = "put", delete = "delete"
 }

//  Copyright © 2016 Tapglue. All rights reserved.
//

import Alamofire

class Router {


        request.setValue(UIDevice.current.systemVersion, forHTTPHeaderField: "X-Tapglue-OSVersion")
        
        if method == .post || method == .put{
            do {
                request.httpBody = try JSONSerialization.data(withJSONObject: payload, options: [])
                request.setValue("application/json", forHTTPHeaderField: "Content-Type")
                return request
            } catch {
                return request
            }
        } else {
            return request
        }
