我已经实现了NSURLConnectionDelegate,似乎我已经成功地发送了一个post请求,在理论上应该让我登录。request, delegate: self, startImmediately: false)connection.start()// You can parse the stuff in your instance variable now
print ("
我设置passport-local来登录用户,一旦登录,将通过passport-JWT为用户提供一个JWT令牌。withCredentials: true, } 此请求成功通过身份验证并从现在重点来了:当我使用完全相同的请求结构,但在axios请求和后端的express路由中将方法切换为post时,请求总是以401 U
success = false, error = "You are not authorized to perform that action" });Response.StatusCode = 401"You are not authorized to perform that action" });
在错误处理程序error: function (xhr, status, error) 中,当状态代码设置为时我想知道哪些响应代码aJax实际上认为是“错误”?