I’m playing around with ParseSwift and a local Parse Server (4.5.0). Whenever I try to perform a query or saving an object to the server I get the error below. Not sure what I’m doing wrong…
ParseError code=-1 error=Error decoding parse-server response: Optional(<NSHTTPURLResponse: 0x600003071700> { URL: http://0.0.0.0:4040//classes/Link } { Status Code: 404, Headers {
Connection = (
"keep-alive"
);
"Content-Length" = (
153
);
"Content-Security-Policy" = (
"default-src 'none'"
);
"Content-Type" = (
"text/html; charset=utf-8"
);
Date = (
"Sun, 14 Mar 2021 13:20:46 GMT"
);
"Keep-Alive" = (
"timeout=5"
);
"X-Content-Type-Options" = (
nosniff
);
"X-Powered-By" = (
Express
);
} }) with error: The data couldn’t be read because it isn’t in the correct format.
My Link object:
struct Link: ParseObject {
var objectId: String?
var createdAt: Date?
var updatedAt: Date?
var ACL: ParseACL?
var title: String?
}
This is my query:
func myQuery() {
let query = Link.query()
query.find(callbackQueue: .main) { results in
switch results {
case .success(let links):
links.forEach { link in
print("Found link: \(link)")
}
case .failure(let error):
print("Error: \(error.localizedDescription)")
}
}
}