Browse Source

Unified the global request, upload and download external parameters convention.

Christian Noon 10 years ago
parent
commit
92bbee0edb
3 changed files with 12 additions and 12 deletions
  1. 9 9
      Source/Alamofire.swift
  2. 1 1
      Tests/DownloadTests.swift
  3. 2 2
      Tests/UploadTests.swift

+ 9 - 9
Source/Alamofire.swift

@@ -144,7 +144,7 @@ public func request(URLRequest: URLRequestConvertible) -> Request {
 
     :returns: The created upload request.
 */
-public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, file: NSURL) -> Request {
+public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, #file: NSURL) -> Request {
     return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file)
 }
 
@@ -156,7 +156,7 @@ public func upload(method: Method, URLString: URLStringConvertible, headers: [St
 
     :returns: The created upload request.
 */
-public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
+public func upload(URLRequest: URLRequestConvertible, #file: NSURL) -> Request {
     return Manager.sharedInstance.upload(URLRequest, file: file)
 }
 
@@ -172,7 +172,7 @@ public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request {
 
     :returns: The created upload request.
 */
-public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, data: NSData) -> Request {
+public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, #data: NSData) -> Request {
     return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data)
 }
 
@@ -184,7 +184,7 @@ public func upload(method: Method, URLString: URLStringConvertible, headers: [St
 
     :returns: The created upload request.
 */
-public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
+public func upload(URLRequest: URLRequestConvertible, #data: NSData) -> Request {
     return Manager.sharedInstance.upload(URLRequest, data: data)
 }
 
@@ -200,7 +200,7 @@ public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request {
 
     :returns: The created upload request.
 */
-public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, stream: NSInputStream) -> Request {
+public func upload(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, #stream: NSInputStream) -> Request {
     return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream)
 }
 
@@ -212,7 +212,7 @@ public func upload(method: Method, URLString: URLStringConvertible, headers: [St
 
     :returns: The created upload request.
 */
-public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request {
+public func upload(URLRequest: URLRequestConvertible, #stream: NSInputStream) -> Request {
     return Manager.sharedInstance.upload(URLRequest, stream: stream)
 }
 
@@ -284,7 +284,7 @@ public func upload(
 
     :returns: The created download request.
 */
-public func download(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, destination: Request.DownloadFileDestination) -> Request {
+public func download(method: Method, URLString: URLStringConvertible, headers: [String: String]? = nil, #destination: Request.DownloadFileDestination) -> Request {
     return Manager.sharedInstance.download(method, URLString, headers: headers, destination: destination)
 }
 
@@ -296,7 +296,7 @@ public func download(method: Method, URLString: URLStringConvertible, headers: [
 
     :returns: The created download request.
 */
-public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request {
+public func download(URLRequest: URLRequestConvertible, #destination: Request.DownloadFileDestination) -> Request {
     return Manager.sharedInstance.download(URLRequest, destination: destination)
 }
 
@@ -310,6 +310,6 @@ public func download(URLRequest: URLRequestConvertible, destination: Request.Dow
 
     :returns: The created download request.
 */
-public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request {
+public func download(resumeData data: NSData, #destination: Request.DownloadFileDestination) -> Request {
     return Manager.sharedInstance.download(data, destination: destination)
 }

+ 1 - 1
Tests/DownloadTests.swift

@@ -46,7 +46,7 @@ class DownloadResponseTestCase: BaseTestCase {
         var error: NSError?
 
         // When
-        Alamofire.download(.GET, URLString, destination)
+        Alamofire.download(.GET, URLString, destination: destination)
             .response { responseRequest, responseResponse, _, responseError in
                 request = responseRequest
                 response = responseResponse

+ 2 - 2
Tests/UploadTests.swift

@@ -37,7 +37,7 @@ class UploadDataTestCase: BaseTestCase {
         var error: NSError?
 
         // When
-        Alamofire.upload(.POST, URLString, data)
+        Alamofire.upload(.POST, URLString, data: data)
             .response { responseRequest, responseResponse, _, responseError in
                 request = responseRequest
                 response = responseResponse
@@ -76,7 +76,7 @@ class UploadDataTestCase: BaseTestCase {
         var responseError: NSError?
 
         // When
-        let upload = Alamofire.upload(.POST, URLString, data)
+        let upload = Alamofire.upload(.POST, URLString, data: data)
         upload.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in
             let bytes = (bytes: bytesWritten, totalBytes: totalBytesWritten, totalBytesExpected: totalBytesExpectedToWrite)
             byteValues.append(bytes)