Nocilla
Nocilla copied to clipboard
How do I Nocilla in Swift 3?
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?
-
Use this fork: https://github.com/pcantrell/Nocilla/tree/null-annotations
-
I had to explicit cast String to NSString in some places
-
PROFIT!
Needed a few as NSData
too, but 👍, thanks.