weixin_33735676 2015-11-16 10:37 采纳率: 0%
浏览 564

POST 405(不允许使用方法)

I am trying to build a Chrome Extension that uses the BOX api.

I am able to authentificate and enable access for the app, and then I extract and store the access token from the URL.

The next step would be to upload a file to box, and I am trying to use the code they provided on the website with small modifications:

//file - a csv file I created before

var uploadUrl = 'https://upload.box.com/api/2.0/files/General';

// The Box OAuth 2 Header. Add your access token.
var headers = {
    Authorization: 'Bearer '+localStorage.authorization_token
};

$.ajax({
    url: uploadUrl,
    headers: headers,
    type: 'POST',
    // This prevents JQuery from trying to append the form as a querystring
    processData: false,
    contentType: false,
    data: link
}).complete(function ( data ) {
    // Log the JSON response to prove this worked
    console.log(data.responseText);
});

But upon running the code it gives me the following error:

405 (Method Not Allowed)

POST https://upload.box.com/api/2.0/files/General 405 (Method Not Allowed)k.cors.a.crossDomain.send @ jquery.js:4n.extend.ajax @ jquery.js:4downloadCSV @ content.js:351(anonymous function) @ content.js:276 content.js:361

NOTE: I contacted api@box.com and they said they enabled CORS for my account

In my manifest.json I have "permissions": ["tabs", "<all_urls>","storage" , "alarms" ]

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站