SPM Prep – Add multipart POST method to WordPressComRESTAPIInterfacing#765
SPM Prep – Add multipart POST method to WordPressComRESTAPIInterfacing#765
WordPressComRESTAPIInterfacing#765Conversation
| fileName:(NSString * _Nonnull)fileName | ||
| mimeType:(NSString * _Nonnull)mimeType; | ||
|
|
||
| @end |
There was a problem hiding this comment.
A sad but necessary step back into Objective-C.
Luckily, this was a PONSO to begin with even in Swift, so we didn't lose any functionality.
There was a problem hiding this comment.
TIL "Plain Old NSObject" 😄
| fileName:(NSString * _Nonnull)fileName | ||
| mimeType:(NSString * _Nonnull)mimeType; | ||
|
|
||
| @end |
There was a problem hiding this comment.
TIL "Plain Old NSObject" 😄
| returns nil it's because something happened on the request serialization and the network request was not started, but the failure callback | ||
| will be invoked with the error specificing the serialization issues. | ||
| */ | ||
| @objc @discardableResult open func multipartPOST(_ URLString: String, |
There was a problem hiding this comment.
We could add a @nonobj to this function here, so that it won't be bridged to Objective-C, which will conflicts with the other almost exact function. However, if that ever happens for some reason, the compiler probably would warn us, even without @nonobj. Maybe I worry too much...
Given this function a @nonobjc declaration also convey that the other multiparPOST is for Objective-C, not this one.
There was a problem hiding this comment.
TIL "Plain Old NSObject" 😄
TIL @nonobjc 😄
🙌
There was a problem hiding this comment.
Addressed in d7d0bf7.
Auto-merged enabled. Then I'll ship version 15.0.0 as discussed in #767 (comment)
Co-authored-by: Tony Li <tony.li@automattic.com>
Description
Follows up #761 adding a method to the protocol for multipart POST.
Testing Details
Green CI
Next up
Basically, cherry-pick the work from #738 but in a neat and reviewable order:
Sources/andTests/respectively #764Bundlehelper that differentiates between SPM and CocoaPods installationsSee also, #756, #758, #760 which are related to the SPM work but independent from this one.
CHANGELOG.mdif necessary. — N.A.