jQuery (BaseCamp API 용)를 사용하여 아약스를 통해 게시물 요청을하려고하는데 작동하지 않는 것 같습니다. 곱슬 곱슬을 사용하여 작동하도록 할 수 있으므로 jQuery에서 잘못하고있는 것을 알고 있습니다. 내가 jQuery를 함께 노력하고있어 코드의 여기jQuery AJAX 게시물이 작동하지 않지만 말림으로 작동합니다.
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -u my.user.name:my.password -d "<time-entry><person-id>123456</person-id><date>08/23/2009</date><hours>8</hours><description>This is a test.</description></time-entry>" https://my.url.updatelog.com/todo_items/1234567/time_entries.xml
과 :
var post_url = bc_base_url + "/todo_items/" + todo_id + "/time_entries.xml";
var xmlData = "<time-entry><person-id>" + bc_user_id + "</person-id>" +
"<date>" + date + "</date>" +
"<hours>" + time + "</hours>" +
"<description>" + description + "</description>" +
"</time-entry>";
$.ajax({
type: "POST",
url: post_url,
data: xmlData,
dataType: "xml",
contentType: "application/xml",
username: "my.user.name",
password: "my.password",
processData: false,
success: function(msg) {
alert("successfully posted! msg: " + msg + ", responseText = " + this.responseText);
},
error: function (xmlHttpRequest, textStatus, errorThrown) {
alert("error : " + textStatus + ", errorThrown = " + errorThrown);
alert("this.reponseText = " + this.responseText);
}
})
누구나 어떤 아이디어가 여기에 작동 curl 명령이다?
감사합니다.
Firebug에서 열어 볼 때 오류로 되돌아 오는 것은 무엇입니까? 도메인 간 문제 일 수 있습니까? – seanmonstar
같은 도메인에 게시 하시겠습니까? – karim79
참고로, 승인 된 답변의 링크는 Go-Daddy 주차 도메인 페이지로 이동합니다. –