You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The jsonEncodedString not convert Date type,that make response by json with date type will fail.
like this code will return fail to js client
response.setHeader(.contentType, value: "application/json")
let d: [String:Any] = ["a":1, "b":0.1, "c": true, "d":[2, 4, 5, 7, 8],"f":Date()]
do{
try response.setBody(json: d)
}catch{
}
response.completed()
Hope add Date type convert in jsonEncodedString
The text was updated successfully, but these errors were encountered:
The jsonEncodedString not convert Date type,that make response by json with date type will fail.
like this code will return fail to js client
response.setHeader(.contentType, value: "application/json")
let d: [String:Any] = ["a":1, "b":0.1, "c": true, "d":[2, 4, 5, 7, 8],"f":Date()]
do{
try response.setBody(json: d)
}catch{
Hope add Date type convert in jsonEncodedString
The text was updated successfully, but these errors were encountered: