0
は、私が画像をアップロードするAPIを開発しているが、いくつかの問題と、それが生成されるという問題がStrongloopは:悪いContent-TypeヘッダをNodejs strongloopを使用
[Error: bad content-type header, unknown content-type: image/png]
私をアップロードするために使用される方法があります
post.remoteMethod('testing', {
description: 'Post a message',
accepts: [
{arg: 'contenttype', type: 'String', description: 'eg. image/png', required: true, http: {source: 'query'}},
{arg: 'ctx', type: 'object', http: {source: 'context'}}
],
returns: {arg: 'success', root: true},
http: {verb: 'POST', path: '/testing'}
});
post.testing = function (contenttype, ctx, cb) {
console.log(contenttype , ctx);
storageProvider.upload(ctx, function (err, response) {
if (err) throw err;
Log.e(err, response);
});
};