 import Deferred
 
 /*
-Welcome to Drosky, your one and only way of talking to Rest APIs.
-
-Inspired by Moya (https://github.com/AshFurrow/Moya)
-
-*/
+ Welcome to Drosky, your one and only way of talking to Rest APIs.
+ 
+ Inspired by Moya (https://github.com/AshFurrow/Moya)
+ 
+ */
 
 /*
  Things to improve:
  1.- Wrap the network calls in a NSOperation in order to:
-    * Control how many are being sent at the same time
-    * Allow to add priorities in order to differentiate user facing calls to analytics crap
+ * Control how many are being sent at the same time
+ * Allow to add priorities in order to differentiate user facing calls to analytics crap
  2.- Use the Timeline data in Response to calculate an average of the responses from the server
  */
 


public enum HTTPMethod: String {
    case GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH, TRACE, CONNECT
}

public enum HTTPParameterEncoding {

extension DroskyResponse {
    func dataAsJSON() -> [String: AnyObject]? {
        let json: [String: AnyObject]?
        
        do {
            json = try NSJSONSerialization.JSONObjectWithData(self.data, options: NSJSONReadingOptions.AllowFragments) as? [String: AnyObject]
        } catch {
            json = nil
        }
        
        return json
    }
}
