do {
let testObject = LCObject(className: "TestObject")
try testObject.set("words1", value: "Hello world!")
let result = testObject.save()
if let error = result.error {
print(error)
}
} catch {
print(error)
}
报错如下
[💙][debug][LeanCloud][2024-11-25 17:41:46.600][Unknown][#410][lcDebugDescription()]:
------ BEGIN LeanCloud HTTP Request
task: 5
curl: curl -v \
-X POST \
-H "User-Agent: LeanCloud-Swift-SDK/17.11.0" \
-H "X-LC-Sign: 4d194a2822329d974219db40bcbccf03,1732527706596" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-LC-Prod: 1" \
-H "X-LC-Id: XDPmNnVBfPq71jMBkcIh5kT-MdYXbMMI" \
-d "{\"requests\":[{\"method\":\"post\",\"new\":true,\"body\":{\"__internalId\":\"1f04e306ac5140979786fd5a35e75d35\",\"words1\":\"Hello world!\"},\"path\":\"\/1.1\/classes\/TestObject\"}]}" \
"https://xdpmnnvb.api.lncldglobal.com/1.1/batch/save"
------ END
[❤️][error][LeanCloud][2024-11-25 17:41:49.081][Unknown][#451][lcDebugDescription(request:)]: Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}
[💙][debug][LeanCloud][2024-11-25 17:41:49.080][Unknown][#430][lcDebugDescription(request:)]:
------ BEGIN LeanCloud HTTP Response
task: 5
code: 403
error: Response status code was unacceptable: 403.
------ END
LCError(code: 9977, underlyingError: responseValidationFailed(reason: Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode(code: 403)))