0
私はAPIを使用してjsonからPDFを作成しています。Error 400 AngularJSでAPIを使用
私は$http
angularjsサービスを使用していますが、リクエストするとHTTP 400エラーコードが表示されます。
これはコードです。
angular.module('instantPDFApp', [])
.controller('mainController', ['$http', function ($http){
$http.post("https://yogthos.p.mashape.com/", '[{}, ["paragraph", "some text"]]' ,{
headers : {
'Content-Type' : 'application/json',
'X-Mashape-Key' : 'MXQJRkqiLumshE4GCKbhIvtR3ytvp19hpZxjsn2vSk4L5dXrE4'
}
}).then(
function (response) {
document.write(response.data);
},
function() {
console.error("Error");
}
);
}]);