Javascript 角度和云端直接上传400(错误请求)

Javascript 角度和云端直接上传400(错误请求),javascript,angularjs,cloudinary,Javascript,Angularjs,Cloudinary,尝试使用以下代码上载到cloudinary时,我收到一个400错误请求: var file = /* your file */; var cloud_name = 'your cloud_name'; var fd = new FormData(); fd.append('upload_preset', 'seller'); fd.append('file', file); $http .post('https://api.cloudinary.com/v1_1/' + cloud

尝试使用以下代码上载到cloudinary时,我收到一个
400错误请求

var file = /* your file */;
var cloud_name = 'your cloud_name';

var fd = new FormData();

fd.append('upload_preset', 'seller');
fd.append('file', file);

$http
    .post('https://api.cloudinary.com/v1_1/' + cloud_name + '/image/upload', fd, {
        headers: {
            'Content-Type': application/x-www-form-urlencoded,
            'X-Requested-With': 'XMLHttpRequest'
        }
    })
    .success(function (cloudinaryResponse) {

        // do stuff with cloudinary response
        // cloudinaryResponse = { public_id: ..., etc. }

    })
    .error(function (reponse) {


    });

我错过了什么?是否可以进行Cloudinary直接上传?

“内容类型”:未定义?为什么您提到内容类型未定义?@Sujith感谢您的回复。“应用程序/x-www-form-urlencoded”也不起作用。能否尝试更改为
多部分/form data
?另外,共享
X-Cld-Error
消息(在响应中返回)。