{"id":225,"date":"2012-07-06T07:00:51","date_gmt":"2012-07-05T22:00:51","guid":{"rendered":"http:\/\/appsweets.net\/blog\/?p=225"},"modified":"2012-07-06T07:00:51","modified_gmt":"2012-07-05T22:00:51","slug":"file-io-2","status":"publish","type":"post","link":"http:\/\/appsweets.net\/blog\/2012\/07\/06\/file-io-2\/","title":{"rendered":"file i\/o #2"},"content":{"rendered":"<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>jsOAuth \u3067\u6c17\u306b\u306a\u308b\u70b9\u304c\u3044\u304f\u3064\u304b\u3042\u308b\u3002<\/p>\n<ol>\n<li>fetchRequestToken()\u3001fetchAccessToken() \u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u306e\u540d\u306e\u3068\u304a\u308a\u306e\u50cd\u304d\u3092\u3059\u308b\u306e\u3060\u304c\u3001\u3057\u304b\u3057\u30ea\u30af\u30a8\u30b9\u30c8\u304c GET \u56fa\u5b9a\u306a\u306e\u3060\u3002dropbox \u3067\u306f\u8a72\u5f53\u3059\u308b api \u306f POST \u3067\u6295\u3052\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\uff08\u3068\u3044\u3044\u3064\u3064\u3001GET \u3067\u6295\u3052\u3066\u3082\u53d7\u3051\u4ed8\u3051\u3066\u306f\u304f\u308c\u308b\u2026\u2026\u4eca\u306e\u3068\u3053\u308d\u306f\uff09\u306e\u3067\u3061\u3087\u3063\u3068\u56f0\u308b\u3002\n<p>\u305d\u3046\u3044\u3046\u308f\u3051\u3067\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u308f\u305a\u3001\u4e0b\u4f4d\u306e\u30e1\u30bd\u30c3\u30c9 post() \u3092\u547c\u3076\u3057\u304b\u306a\u3044\u3002\u4e0a\u8a18\u306e fetch*() \u3067\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3067\u304d\u305f\u3089\u5b09\u3057\u3044\u306a\u30fc<\/li>\n<li>\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u305f\u969b\u306b\u30a8\u30e9\u30fc\u304c\u5e30\u3063\u3066\u304d\u305f\u5834\u5408\u3001http \u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u4f55\u306e\u30a8\u30e9\u30fc\u304b\u5224\u65ad\u3057\u305f\u3044\u306e\u3060\u304c\u3001request() \u306f xhr.status \u3092\u8fd4\u3057\u3066\u304f\u308c\u306a\u3044\u3002\u8fd4\u3057\u3066\u304f\u308c\u305f\u3089\u5b09\u3057\u3044\u306a\u30fc<\/li>\n<li>\u307e\u3060 Firefox \u3067\u306f\u52d5\u304b\u3057\u3066\u3044\u306a\u3044\u304c\u3001\u30bd\u30fc\u30b9\u3092\u898b\u308b\u9650\u308a\u3001XMLHttpRequest \u3092\u751f\u6210\u3059\u308b\u7b87\u6240\u304c<br \/>\n<code lang=\"javascript\"><br \/>\n} else if (typeof require !== 'undefined') {<br \/>\n    \/\/ CommonJS require<br \/>\n    try {<br \/>\n        XHR = new require(\"xhr\").XMLHttpRequest();<br \/>\n    } catch (e) {<br \/>\n        \/\/ module didn't expose correct API or doesn't exists<br \/>\n        if (typeof global.XMHttpRequest !== \"undefined\") {<br \/>\n            XHR = new global.XMLHttpRequest();<br \/>\n        } else {<br \/>\n            throw \"No valid request transport found.\";<br \/>\n            return null;<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n<\/code><br \/>\n\u3068\u3044\u3046\u3088\u3046\u306a\u611f\u3058\u306a\u306e\u3067\u3001\u305f\u3076\u3093 Add on SDK \u4e0b\u3067\u306f\u305f\u3076\u3093\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002SDK \u3067\u306f<br \/>\n<code lang=\"javascript\"><br \/>\nrequire(\"api-utils\/xhr\");<br \/>\n<\/code><br \/>\n\u306a\u306e\u3060\u3002Add on SDK \u306b\u5bfe\u5fdc\u3057\u3066\u3082\u3089\u3048\u308b\u304b\u3001xhr \u306e\u30d5\u30a1\u30af\u30c8\u30ea\u3092\u5916\u306b\u51fa\u3057\u3066\u304f\u308c\u308b\u3068\u5b09\u3057\u3044\u306a\u30fc<\/li>\n<\/ol>\n<div class=\"856f7bdf6ce2541193600c6e03dd1a56\" data-index=\"1\" style=\"float: left; margin: 16px 16px 16px 0;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-5825700137064158\";\r\n\/* 250sq, appsweets-blog *\/\r\ngoogle_ad_slot = \"4837931762\";\r\ngoogle_ad_width = 250;\r\ngoogle_ad_height = 250;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>jsOAuth \u3067\u6c17\u306b\u306a\u308b\u70b9\u304c\u3044\u304f\u3064\u304b\u3042\u308b\u3002 fetchRequestToken()\u3001fetchAccessToken() \u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u306e\u540d\u306e\u3068\u304a\u308a\u306e\u50cd\u304d\u3092\u3059\u308b\u306e\u3060\u304c\u3001\u3057\u304b\u3057\u30ea\u30af\u30a8\u30b9\u30c8\u304c GET \u56fa\u5b9a\u306a\u306e\u3060\u3002dropbox \u3067\u306f\u8a72\u5f53\u3059\u308b api \u306f POST \u3067\u6295\u3052\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\uff08\u3068\u3044\u3044\u3064\u3064\u3001GET \u3067\u6295\u3052\u3066\u3082\u53d7\u3051\u4ed8\u3051\u3066\u306f\u304f\u308c\u308b\u2026\u2026\u4eca\u306e\u3068\u3053\u308d\u306f\uff09\u306e\u3067\u3061\u3087\u3063\u3068\u56f0\u308b\u3002 \u305d\u3046\u3044\u3046\u308f\u3051\u3067\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u308f\u305a\u3001\u4e0b\u4f4d\u306e\u30e1\u30bd\u30c3\u30c9 post() \u3092\u547c\u3076\u3057\u304b\u306a\u3044\u3002\u4e0a\u8a18\u306e fetch*() \u3067\u30ea\u30af\u30a8\u30b9\u30c8\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3067\u304d\u305f\u3089\u5b09\u3057\u3044\u306a\u30fc \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u305f\u969b\u306b\u30a8\u30e9\u30fc\u304c\u5e30\u3063\u3066\u304d\u305f\u5834\u5408\u3001http \u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u4f55\u306e\u30a8\u30e9\u30fc\u304b\u5224\u65ad\u3057\u305f\u3044\u306e\u3060\u304c\u3001request() \u306f xhr.status \u3092\u8fd4\u3057\u3066\u304f\u308c\u306a\u3044\u3002\u8fd4\u3057\u3066\u304f\u308c\u305f\u3089\u5b09\u3057\u3044\u306a\u30fc \u307e\u3060 Firefox \u3067\u306f\u52d5\u304b\u3057\u3066\u3044\u306a\u3044\u304c\u3001\u30bd\u30fc\u30b9\u3092\u898b\u308b\u9650\u308a\u3001XMLHttpRequest \u3092\u751f\u6210\u3059\u308b\u7b87\u6240\u304c } else if (typeof require !== &#8216;undefined&#8217;) { \/\/ CommonJS require try { XHR &hellip; <a href=\"http:\/\/appsweets.net\/blog\/2012\/07\/06\/file-io-2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,3,4],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-javascript","tag-vi","tag-wasavi"],"_links":{"self":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":2,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":227,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions\/227"}],"wp:attachment":[{"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appsweets.net\/blog\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}