         }
     }
     
+    func mockResponse(request: NSURLRequest) -> NSURLResponse? {
+        
+        let requestMethod = RequestMethod(rawValue: request.HTTPMethod!)!
+        
+        let mockURL = mockURLForRequestURL(request.URL!, requestMethod: requestMethod, mocks: mocks)
+        if mockURL == request.URL {
+            return nil
+        }
+        guard let mockedHeaderFields = mockedHeaderFields(request.URL!, requestMethod: requestMethod, mocks: mocks) else {
+            return nil
+        }
+        var statusCode = 200
+        if let statusString = mockedHeaderFields["status"], let responseStatus = Int(statusString) {
+            statusCode = responseStatus
+        }
+        
+        let mockedResponse = NSHTTPURLResponse(URL: request.URL!, statusCode: statusCode, HTTPVersion: nil, headerFields: mockedHeaderFields )
+        
+        return mockedResponse
+    }
+    
+    func recordResponseHeadersForRequest(headers:[NSObject:AnyObject], request: NSURLRequest, response: NSHTTPURLResponse) {
+        
+        var headersModified : [NSObject:AnyObject] = headers
+        headersModified["status"] = "\(response.statusCode)"
+        
+        recordResponseHeadersDataForRequest(NSKeyedArchiver.archivedDataWithRootObject(headersModified), request: request)
+    }
+    
+    private func mockedHeaderFields(url: NSURL, requestMethod: RequestMethod, mocks: Dictionary<String,AnyObject>)->[String : String]? {
+        
+        guard let mockedHeaderFieldsURL = mockURLForRequestRestponseURL(url, requestMethod: requestMethod, mocks: mocks) else {
+            return nil
+        }
+        guard let mockedHeaderFieldData = NSData(contentsOfURL: mockedHeaderFieldsURL) else {
+            return nil
+        }
+        guard let mockedHeaderFields = NSKeyedUnarchiver.unarchiveObjectWithData(mockedHeaderFieldData) as? [String : String] else {
+            return nil
+        }
+        return mockedHeaderFields
+    }
 }
 
 // MARK: File extension

     */
    func recordDataForRequest(data: NSData?, request: NSURLRequest) {
        
        guard let definitionsPath = mockFileOutOfBundle(),
            let definitions = NSMutableDictionary(contentsOfFile: definitionsPath),
            let absoluteString = request.URL?.absoluteString,
            let httpMethod = request.HTTPMethod,
            let url = request.URL,
            let responseFile = mockedResponseFileName(url),
            let responsePath = mockedResponseFilePath(url),
            let data = data else {
                return
        }

            
            if let responsePath = bundle?.pathForResource(responseFile, ofType: "") {
                return NSURL(fileURLWithPath: responsePath)
            }
        }
        if let responsePath = mockedResponseHeadersFilePath(url) where !isData {
            return NSURL(fileURLWithPath: responsePath)
        }
        
        if let responsePath = mockedResponseFilePath(url) where isData {
            return NSURL(fileURLWithPath: responsePath)
        }
        return url
    }
