Nocilla icon indicating copy to clipboard operation
Nocilla copied to clipboard

How do I Nocilla in Swift 3?

Open ratkins opened this issue 8 years ago • 2 comments

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": "[email protected]" ])
    .withBody(try! JSON(["body"]).serialize())

How do I spell this in Swift 3?

ratkins avatar Nov 15 '16 10:11 ratkins

  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!

vitalys avatar Nov 15 '16 11:11 vitalys

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

ratkins avatar Nov 15 '16 12:11 ratkins