This is my Json request
var postsEndpoint = "http://test/Search"
let test = ["SearchCriteria":["ForeName":"jack", "Surname":"jill"]];
request(.POST, postsEndpoint, parameters: test, encoding: .JSON)
.responseJSON { (request, response, data, error) in
if let anError = error
{
println("error calling POST on /posts")
println(error)
}
else if let data: AnyObject = data
{
let post = JSON(data)
println("The post is: " + post.description)
}
Is there an issue with my request as I am getting the following error:
error calling POST on /posts Optional(Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 3.) UserInfo=0x7fdd00414c80 {NSDebugDescription=Invalid value around character 3.})
responseStringto log the string representation to see what's the matter. - mattt