除了_User Class, 尝试在其他自建Class添加数据也是同样的问题
my.httpRequest({
url: "https://ghpbdaln.api.lncld.net/1.1/users",
method: "POST",
headers: {
"Content-Type": "application/json",
"X-LC-Id": ".......",
"X-LC-Key": "........."
},
data: '{"username":"3EmR8KW4PYBYZSMJ66TawFiZyZApAfEG","password":"KHbzjAEF5rMrDk68c4Q8DDSSP4E2mZ6X"}',
success: function (res) {
},
fail: function (res) {
},
complete: function (res) {
}
});
模拟器添加数据正常,返回正常:
{"data":{"sessionToken":"uvfg67qhfo62eh4eu3skasgnc","updatedAt":"2017-11-15T15:52:04.530Z","objectId":"5a0c62a4ee920a00451b56c4","username":"ecrcGtKsQe2yWTFhG2fJF52MKdCaxwT6","createdAt":"2017-11-15T15:52:04.530Z","emailVerified":false,"payCounter":0,"cupCounter":0,"discount":0,"mobilePhoneVerified":false},"status":201,"headers":{"cache-control":"no-cache,no-store","content-type":"application/json;charset=utf-8","pragma":"no-cache"}}
ios真机添加数据正常,但是返回报错404:
{"status":404,"headers":{"Content-Type":"application/json;charset=utf-8","Pragma":"no-cache","Content-Encoding":"gzip","Server":"nginx/1.6.2","Cache-Control":"no-cache,no-store","Date":"Wed, 15 Nov 2017 15:43:39 GMT","x-spdy-header-time":"310.142994","x-via-mobileproxy":"1","x-spdy-version":"3","x-spdy-proxy":"1","x-spdy-stream-id":"9","Vary":"Accept-Encoding, Accept-Encoding"},"data":{"code":1,"error":"Not Found"},"error":19,"errorMessage":"http status error"}