@@ -268,11 +268,11 @@ open class WordPressComRestApi: NSObject {
268268 - parameter success: callback to be called on successful request
269269 - parameter failure: callback to be called on failed request
270270
271- - returns: a NSProgress object that can be used to track the progress of the upload and to cancel the upload. If the method
271+ - returns: a `Progerss` object that can be used to track the progress of the upload and to cancel the upload. If the method
272272 returns nil it's because something happened on the request serialization and the network request was not started, but the failure callback
273273 will be invoked with the error specificing the serialization issues.
274274 */
275- @objc @ discardableResult open func multipartPOST( _ URLString: String ,
275+ @discardableResult open func multipartPOST( _ URLString: String ,
276276 parameters: [ String : AnyObject ] ? ,
277277 fileParts: [ FilePart ] ,
278278 requestEnqueued: RequestEnqueuedBlock ? = nil ,
@@ -605,7 +605,6 @@ extension WordPressAPIError<WordPressComRestApiEndpointError> {
605605}
606606
607607extension WordPressComRestApi : WordPressComRESTAPIInterfacing {
608-
609608 // A note on the naming: Even if defined as `GET` in Objective-C, then method gets converted to Swift as `get`.
610609 //
611610 // Also, there is no Objective-C direct equivalent of `AnyObject`, which here is used in `parameters: [String: AnyObject]?`.
@@ -629,4 +628,22 @@ extension WordPressComRestApi: WordPressComRESTAPIInterfacing {
629628 ) -> Progress ? {
630629 POST ( URLString, parameters: parameters, success: success, failure: failure)
631630 }
631+
632+ public func multipartPOST(
633+ _ URLString: String ,
634+ parameters: [ String : NSObject ] ? ,
635+ fileParts: [ FilePart ] ,
636+ requestEnqueued: @escaping ( NSNumber ) -> Void ,
637+ success: @escaping ( Any , HTTPURLResponse ? ) -> Void ,
638+ failure: @escaping ( any Error , HTTPURLResponse ? ) -> Void
639+ ) -> Progress ? {
640+ multipartPOST (
641+ URLString,
642+ parameters: parameters,
643+ fileParts: fileParts,
644+ requestEnqueued: requestEnqueued,
645+ success: success as SuccessResponseBlock ,
646+ failure: failure as FailureReponseBlock
647+ )
648+ }
632649}
0 commit comments