Skip to content

Instantly share code, notes, and snippets.

@roothybrid7
Created October 17, 2011 01:45
Show Gist options
  • Save roothybrid7/1291743 to your computer and use it in GitHub Desktop.
Save roothybrid7/1291743 to your computer and use it in GitHub Desktop.
xhrdavclient v0.1.0変更点
goog.require('xhrdav.DavFs');
goog.require('xhrdav.HttpStatus');
# 変更前
xhrdav.lib.DavFs.getInstance().upload(path, file. handler, null, null, callback_context, onComplete);
# 変更後(namespaceからlibを消して、getRequest()をよんでからAPIを呼ぶ)
xhrdav.DavFs.getInstance().getRequest().upload(path, file, handler, null, null, callback_context, opt_helper, onComplete);
#Basic認証
var davFs = xhrdav.DavFs.getInstance();
#ログイン時に設定
davFs.addConnection({auth: <auth_hash>});
# リクエスト作成時に設定
var request = davFs.getRequest({auth: <auth_hash>}); // 設定されていなければ設定
var request2 = davFs.getRequest({auth: <auth_hash>, authOverwrite: true}); // 強制的に新しいものに設定
# HTTPリクエストヘッダで毎回指定する
davFs.getRequest().listDir(path, handler, {authorization: <auth_hash>}, null, callback_context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment