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

How do I Nocilla in Swift 3? #150

Open
ratkins opened this issue Nov 15, 2016 · 2 comments
Open

How do I Nocilla in Swift 3? #150

ratkins opened this issue Nov 15, 2016 · 2 comments

Comments

@ratkins
Copy link

ratkins commented Nov 15, 2016

The following line parsed and worked fine using Nocilla (0.11.0) in Swift 2:

stubRequest("POST", "\(baseURL)/hello")
    .withHeaders([ "content-type": "application/json", "USER_ID": "foo@bar.com" ])
    .withBody(try! JSON(["body"]).serialize())

How do I spell this in Swift 3?

@vitalys
Copy link

vitalys commented Nov 15, 2016

  1. Use this fork: https://github.com/pcantrell/Nocilla/tree/null-annotations

  2. I had to explicit cast String to NSString in some places

  3. PROFIT!

@ratkins
Copy link
Author

ratkins commented Nov 15, 2016

Needed a few as NSData too, but 👍, thanks.

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

No branches or pull requests

2 participants