 
     public func request(
             method:          Alamofire.Method,
-            json:            AnyObject,
+            json:            NSJSONConvertible,
             requestMutation: NSMutableURLRequest -> () = { _ in })
         -> Request
         {
-        if(!NSJSONSerialization.isValidJSONObject(json))
+        guard NSJSONSerialization.isValidJSONObject(json) else
             {
             return FailedRequest(
                 Resource.Error(userMessage: "Cannot encode JSON", debugMessage: "Not a valid JSON object"))

    
    func cancel() { }
    }

            }
        catch
            {
            // This catch block should obviate the isValidJSONObject() call above, but Swift apparently
            // doesn’t catch NSInvalidArgumentException (radar 21913397).
            return FailedRequest(
                Resource.Error(userMessage: "Cannot encode JSON", error: error as NSError))
            }
