我可以在backbone.js中设置content-type
和吗?POST
this.save(data, {
success: function (user) {
callback(user.get('LoginStatus'))
},
error: function (user, result, xhr) {
}
});
当我尝试进行 REST 服务调用时,我收到了错误的请求,它在提琴手中工作。我们需要设置类型和内容类型吗?
这是我得到的错误
[ERROR][TiHttpClient( 636)] (TiHttpClient-1) [13340,13340] HTTP Error (org.apache.http.client.HttpResponseException): Bad Request
[ERROR][TiHttpClient( 636)] org.apache.http.client.HttpResponseException: Bad Request
[ERROR][TiHttpClient( 636)] at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:240)
[ERROR][TiHttpClient( 636)] at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:199)
[ERROR][TiHttpClient( 636)] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)
[ERROR][TiHttpClient( 636)] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)
[ERROR][TiHttpClient( 636)] at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1217)
[ERROR][TiHttpClient( 636)] at java.lang.Thread.run(Thread.java:1020)
[ERROR][TiAPI ( 636)] [REST API] ERROR: " *** FaultException : Object reference not set to an instance of an object."
[ERROR][TiAPI ( 636)] [REST API] apiCall ERROR: " *** FaultException : Object reference not set to an instance of an object."