Swift - Wrong date format (JSON .NET) -


i'm trying make api call alamofire in app, strange error.

'there error deserializing object of type tucson.geocaching.wcf.api.createtrackablelogrequestv1. datetime content '\/date(1452942271163+0500)\/' not start '\/date(' , end ')\/' required json.' 

on website of api date format must this: "\/date(928174800000-0700)\/"

my code:

posttblog("gsycnp", text: "test", date: "\\/date(928174800000-0700)\\/", logtype: 48)  func posttblog (code: string, text: string, date: string, logtype: int) -> bool {     if let apikey = apikey {         let url = "https://api.groundspeak.com/livev6/geocaching.svc/createtrackablelog"         let parameters:[string : anyobject] = ["accesstoken":apikey, "trackingnumber":code, "utcdatelogged": date, "note":text, "logtype":logtype]          alamofire.request(.post, url, parameters: parameters, encoding: .json).responsestring { response in             print(response)         }            return true     } else {         return false     } } 

i have tried different things nothing seamed work. happy if me, thx.

it worked after turned "\\/date(928174800000-0700)\\/" "/date(928174800000)/"


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -