Json Request Using AlamoFire -
this 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 issue request getting following error:
error calling post on /posts optional(error domain=nscocoaerrordomain code=3840 "the operation couldn’t completed. (cocoa error 3840.)" (invalid value around character 3.) userinfo=0x7fdd00414c80 {nsdebugdescription=invalid value around character 3.})
late, found thread.
i ran same problem running django dev server , got you called url via post, url doesn't end in slash , have append_slash set. django can't redirect slash url while maintaining post data.
append slash postsendpoint
becomes...
var postsendpoint = "http://test/search"
Comments
Post a Comment