Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipart upload #483

Merged
merged 21 commits into from Jul 8, 2016
Merged

Multipart upload #483

merged 21 commits into from Jul 8, 2016

Conversation

leonereveel
Copy link
Contributor

@leonereveel leonereveel commented May 12, 2016

This the same implementation as #481 but is based on master branch.

I need to support file upload using Moya and after look at #114 discussion, I decided to implement my own solution.

I just added a MultipartTargetType protocol and made some extensions to MoyaProvider where the Target matches the new type.

Here is an example:

enum MyAwesomeAPI {
  case EndpointWithImageUpload(NSURL)
}
// Extend from MultipartTargetType
extension MyAwesomeAPI: MultipartTargetType {
   var path: ...
   var parameters: ...
   var method: ...
   var sampleData: ...
   var multipartBody:[MultipartFormData] {
        switch self {
        case .EndpointWithImageUpload(let imageUrl):
                return [MultipartFormData(provider: .File(contentFile), name: "files", mimeType:"image/jpeg", fileName: "photo.jpg")]
        default:
            return []
        }
    }
}
// Call the api
RxMoyaProvider<MyAwesomeAPI>()
    .requestWithProgress(MyAwesomeAPI.CallWithImageUpload(fileUrl))
    .filterCompleted()
    .mapToJSON().....

requestWithProgress method returns a ProgressResponse that contains the progress and the response result when the http call is completed. Use the method filterCompleted() to get the actual Response and filterProgress() to get the progress of the Upload.

I had some trouble to compile and test the project. I can create some tests and add to this PR if some one help me with that.

Thank you and enjoy!

@leonereveel
Copy link
Contributor Author

Hey @ashfurrow! I improved the API a little bit. I created a ProgressResponse and added some filter methods to get the response and the result. I created a new method called requestWithProgress to not collide with actual request method. After all this work I thought: What do not make some more changes and add progress to all HTTP calls? What do you think?

@ashfurrow
Copy link
Member

Cool! Want to email me at ash@ashfurrow.com to schedule a time that works?

@leonereveel leonereveel force-pushed the multipart-upload branch 2 times, most recently from 373e284 to 7deaa41 Compare May 24, 2016 18:51
@ashfurrow
Copy link
Member

ashfurrow commented May 28, 2016

Cool, this looks awesome. I think we have the following TODOs to get this wrapped up:

  • Add ReactiveCocoa extension for requesting.
  • Add documentation for multipart requests.
  • Add tests for new functionality.
  • Changelog entry.

I'll try to take a look at this this weekend.

@hirad
Copy link

hirad commented May 31, 2016

@leonereveel: I just needed multipart upload and started using your fork.

Once I changed my TargetType to conform to MultipartTargetType, I had to change all my existing references to request to include progress: nil parameter because of the ambiguity.

I tried experimenting with a slightly different API that I think is simpler. What do you guys think?

@@ -4,6 +4,28 @@ import Result
/// Closure to be executed when a request has completed.
public typealias Completion = (result: Result<Moya.Response, Moya.Error>) -> ()

public typealias ProgressBlock = (progress:ProgressResponse) -> Void
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency with the rest of the code, I think we should add a space after : (progress: ProgressResponse). Doesn't have to be part of this PR, we could clean up afterwards. 😃

Copy link

Choose a reason for hiding this comment

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

Agreed!

@colinta
Copy link
Contributor

colinta commented May 31, 2016

Definitely good stuff in this PR - and I like @hirad's changes in his experimental branch, FWIW.

@leonereveel
Copy link
Contributor Author

leonereveel commented May 31, 2016

Cool guys! Let me know if you need any contribution. @hirad The way you did works very well and make things more simple. I'll try it out here.

let plugins = self.plugins

let multipartFormData = { (form:RequestMultipartFormData) -> Void in
let params = decodeHTTPBody(request.HTTPBody)
Copy link

Choose a reason for hiding this comment

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

This part is a little iffy to me. What happens if the parameter encoding wasn't .URL? Then the value in params here will be malformed. I'm not sure what'd be the best way to handle encoding of additional parameters in a multipart upload.

One option might be wrapping Alamofire's ParameterEncoding and providing our own encoding option for multipart?

In any case, I think decoding the already-encoded value is problematic. We have access to all the raw values anyway (through target.parameters or better yet self.endpoint(target).parameters). I think we should use that directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hirad I merged your pull request and added the parameter encoding using Alamofire's URL encoding. I don't think we need to support other encoding types on multipart form.

Hey @ashfurrow! @hirad added RxCocoa support. =)

@codecov-io
Copy link

codecov-io commented Jun 18, 2016

Current coverage is 65.02%

Sunburst

No coverage report found for master at e9a1382.

Powered by Codecov. Last updated by e9a1382...77dea94

@AndrewSB
Copy link
Member

@leonereveel this looks great! What's left before we can use it?

@leonereveel
Copy link
Contributor Author

@AndrewSB I need to do some tests, which I will have time next week. Community review and merge.

@colinta
Copy link
Contributor

colinta commented Jun 23, 2016

I'm def happy to review this, I'm excited to (finally!) get uploads into Moya. Please ping me (@colinta) when it's ready (and @Moya/contributors).

@MoyaBot
Copy link

MoyaBot commented Jul 6, 2016

1 Error
🚫 No Changelog entries made
1 Warning
⚠️ Big PR

SwiftLint found issues\n\n#### Warnings

File Line Reason
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.
Moya.swift 397 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 398 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya.swift 379 Colons should be next to the identifier when specifying a type.
Moya.swift 400 Force unwrapping should be avoided.
Moya.swift 14 Lines should not have trailing whitespace.
Moya.swift 20 Lines should not have trailing whitespace.
Moya.swift 24 Lines should not have trailing whitespace.
Moya.swift 48 Lines should not have trailing whitespace.
Moya.swift 55 Lines should not have trailing whitespace.
Moya.swift 105 Lines should not have trailing whitespace.
Moya.swift 109 Lines should not have trailing whitespace.
Moya.swift 180 Lines should not have trailing whitespace.
Moya.swift 247 Lines should not have trailing whitespace.
Moya.swift 252 Lines should not have trailing whitespace.
Moya.swift 256 Lines should not have trailing whitespace.
Moya.swift 259 Lines should not have trailing whitespace.
Moya.swift 261 Lines should not have trailing whitespace.
Moya.swift 269 Lines should not have trailing whitespace.
Moya.swift 275 Lines should not have trailing whitespace.
Moya.swift 287 Lines should not have trailing whitespace.
Moya.swift 297 Lines should not have trailing whitespace.
Moya.swift 299 Lines should not have trailing whitespace.
Moya.swift 302 Lines should not have trailing whitespace.
Moya.swift 378 Lines should not have trailing whitespace.
Moya.swift 382 Lines should not have trailing whitespace.
Moya.swift 394 Lines should not have trailing whitespace.
Moya.swift 404 Lines should not have trailing whitespace.
Moya.swift 410 Lines should not have trailing whitespace.
Moya.swift 417 Lines should not have trailing whitespace.
Moya.swift 431 Lines should not have trailing whitespace.
Moya.swift 433 Lines should not have trailing whitespace.
Moya.swift 435 Lines should not have trailing whitespace.
Moya.swift 441 Lines should not have trailing whitespace.
Moya.swift 445 Lines should not have trailing whitespace.
Moya.swift 533 Lines should not have trailing whitespace.
Moya.swift 545 Lines should not have trailing whitespace.
Moya.swift 420 Else and catch should be on the same line, one space after the previous declaration.
Moya.swift 547 File should contain 400 lines or less: currently contains 547
Moya+ReactiveCocoa.swift 72 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 83 Lines should not have trailing whitespace.
Moya+ReactiveCocoa.swift 89 Lines should not have trailing whitespace.
Moya+RxSwift.swift 48 Opening braces should be preceded by a single space and on the same line as the declaration.
Moya+RxSwift.swift 46 Lines should not have trailing whitespace.
Moya+RxSwift.swift 58 Lines should not have trailing whitespace.
Moya+RxSwift.swift 63 Lines should not have trailing whitespace.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 71 Opening braces should be preceded by a single space and on the same line as the declaration.
Observable+Moya.swift 62 Force unwrapping should be avoided.
Observable+Moya.swift 55 Lines should not have trailing whitespace.
Observable+Moya.swift 58 Lines should not have trailing whitespace.
Observable+Moya.swift 64 Lines should not have trailing whitespace.
Observable+Moya.swift 67 Lines should not have trailing whitespace.

Errors

File Line Reason
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.
Moya.swift 249 Prefer checking isEmpty over comparing count to zero.

Generated by 🚫 danger

@orta
Copy link
Member

orta commented Jul 6, 2016

^ Looks like Swift-lint is running once per target, might want to have an option there

@leonereveel
Copy link
Contributor Author

I merged from master and improved the code a little bit. Can anyone help me to test it? @colinta?

@colinta
Copy link
Contributor

colinta commented Jul 6, 2016

Cool! I will not be able to today, but definitely will do tomorrow.

@leonereveel
Copy link
Contributor Author

leonereveel commented Jul 8, 2016

If define CancellableWrapper as class, this shouldn't be a problem. The object will be returned as reference and the innerCancellable property will be updated after Alamofire builds the multipart. The cancel method on that class should set isCancelled to true event if innnerCancellable was not set yet.

@colinta
Copy link
Contributor

colinta commented Jul 8, 2016

No it's still not as simple as that, but I'm learning more about what's going on.

So because performNetworking is asynchronous (or it can be - in the case of using OAuth, for example), assigning to cancellableToken inside of performNetworking will have no effect on the code that calls request.

func request() -> String {
    var cancellable = "foo"
    inOneSecond {
        cancellable = "bar"
    }
    return cancellable
}

request() // always "foo"

BUT, I see that multipartFormData is not called synchronously, and so I think the issue here is that innerCancellable doesn't have a default value - something that can assign and store the isCancelled value.

I propose this: for one, I agree that it seems like CancellableWrapper should be a class, not a struct, because we're treating it as a reference. Next, I think that innerCancellable should be a Cancellable, not a CancellableToken. Then, we can assign a default value to innerCancellable that can be "canceled" while the request is being constructed. Because until innerCancellable is assigned, the request isn't cancellable, which seems like a bug.

Something like this:

// change to a class, for reference semantics
internal class CancellableWrapper: Cancellable {
    // calling cancel() on this initial instance will just update the canceled value
    internal var innerCancellable: Cancellable = SimpleCancellable()

    // renamed 'isCancelled' for consistency
    var canceled: Bool { return innerCancellable.canceled ?? false }

    internal func cancel() {
        innerCancellable.cancel()
    }
}

internal class SimpleCancellable: Cancellable {
    var canceled = false
    func cancel() {
        canceled = true
    }
}

@colinta
Copy link
Contributor

colinta commented Jul 8, 2016

I'm creating #530 to address this issue - and I've got a branch that combines #530 and #483 here: https://github.com/colinta/Moya/tree/multipart-after-refactor

@leonereveel
Copy link
Contributor Author

Good solution @colinta! 👍

I'm looking forward to see everything merge into master branch (upload and this refactoring). I'm glad to see that this discussion solved another possible bug.

@leonereveel
Copy link
Contributor Author

@ashfurrow @colinta If you need any help to document this, let me know. I can do that this weekend.

@ashfurrow
Copy link
Member

This is fantastic work and a great example of open source collaboration. Thanks everyone!

Wondering about the new property in the TargetType protocol: var multipartBody: [MultipartFormData]? { get }. Could we have a protocol extension that has a default implantation that returns nil? Or would that override the user's implementation?

@leonereveel
Copy link
Contributor Author

I tried that @ashfurrow and it override user's implementation. One of my commits was only to remove the extension.

@ashfurrow
Copy link
Member

💯

colinta and others added 4 commits July 8, 2016 13:12
…actor-2

* colinta/refactor/cancellables:
  new specs: tests Cancellable and cancel() logic
  fixes to specs around Cancellable changes
  renamed 'canceled' to 'cancelled' for consistency w/ protocol names
  refactor Cancellables: use class semantics, assign default 'innerCancellable'
  a non-cancelled request spec
  [Danger] Updates SwiftLint plugin.
  add Changelog entry
  remove NetworkCurlLogger.swift from .xcodeproj
Brings in the updates from the Cancellable refactors
@leonereveel
Copy link
Contributor Author

Fixed multipart-parameters encoding. I didn't know that this must be encoded differently.

@ashfurrow
Copy link
Member

Tests pass, not sure why Danger failed but I'm gonna merge 💯

@ashfurrow ashfurrow merged commit f3f7570 into Moya:master Jul 8, 2016
@ashfurrow
Copy link
Member

Thanks a lot for contributing to Moya! I've invited you to join the Moya GitHub organization – no pressure to accept! If you'd like more information on what that means, check out our contributor guidelines and feel free to reach out with any questions.

@colinta
Copy link
Contributor

colinta commented Jul 8, 2016

Sweet! I agree about the collaboration. Great feature, and tons of people working on it - awesome!

On Jul 8, 2016, at 1:57 PM, Leone Parise notifications@github.com wrote:

Fixed multipart-parameters encoding. I didn't know that this must be encoded differently.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

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.

None yet

9 participants