GoogleのデータAPIを使いまくり&つまりまくりなんですが、
とりあえず基本となるAuth -> XMLを送りつけるところを
jqueryで実装してるとこんな感じになるよというメモ。
$.ajax({
url : url,
type : "DELETE", PUTも可(ブラウザに依存)
contentType : 'application/atom+xml; charset=UTF-8', 設定しないとapplication/x-www-form-urlencodedになっちゃうので必須
processData :false, 設定しないとapplication/x-www-form-urlencodedなGETクエリに変換にしちゃうので必須
data: xml_document, ←XMLドキュメント本体
beforeSend : function(request) {
request.setRequestHeader('Authorization', 'GoogleLogin auth=' + token); ←Googleだとこんなかんじ
},
error : function(XMLHttpRequest, status, error){
~~~
},
success: function(result) {
~~~
}
});
}
にしてもマイナーなAPI使うとドキュメントがなさすぎてきつい。。