Skip to content

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Mar 25, 2024

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:

See also, #756, #758, #760 which are related to the SPM work but independent from this one.


  • Please check here if your pull request includes additional test coverage. — N.A.
  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary. — N.A.

fileName:(NSString * _Nonnull)fileName
mimeType:(NSString * _Nonnull)mimeType;

@end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL "Plain Old NSObject" 😄

@mokagio mokagio enabled auto-merge March 25, 2024 08:50
@mokagio mokagio requested a review from crazytonyli March 25, 2024 08:50
fileName:(NSString * _Nonnull)fileName
mimeType:(NSString * _Nonnull)mimeType;

@end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL "Plain Old NSObject" 😄

TIL @nonobjc 😄

🙌

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in d7d0bf7.

Auto-merged enabled. Then I'll ship version 15.0.0 as discussed in #767 (comment)

@mokagio mokagio merged commit 01af35a into trunk Mar 26, 2024
@mokagio mokagio deleted the mokagio/abstract-multiform branch March 26, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants