我正在 Parse Cloud 中尝试这个 POST 函数,并使用 http 响应代码 302 抛出错误。谁能告诉我如何解决这个问题?
Parse.Cloud.httpRequest({
method: 'POST',
url: 'http://siteabcd.com/auth.action',
body: {
username: 'user',
password: 'pass',
button: 'Login',
},
headers: {
'User-Agent' : "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"
},
success: function(httpResponse){
alert("response:"+httpResponse.text+"---header length:"+httpResponse.headers.length);
response.success("Message Sent");
},
error: function(httpResponse){
console.error('Request failed with response code ' + httpResponse.status);
response.error("Message Not Sent");
}
});