我试图连接到外部POST api进行身份验证。 我想:从角度连接到REST API
$http({
method : 'POST',
url : 'myURL',
data : {"j_username": "myUserName,"j_password": "myPassword"},
headers : {
'Content-Type': 'application/x-www-form-urlencoded',
}
})
但我发现了这个错误:
的XMLHttpRequest无法加载http://...url。预检的响应为 无效(重定向)
也许dup http://stackoverflow.com/q/33660712/367865 – Ouroborus
错误是告诉你,当请求时这个URL重定向到另一个。选中此[回答](http://stackoverflow.com/a/36221621/1488993)以获取更多详细信息。 – Doon
你有一个缺少“myUserName后标记太 – rrd