0
我正在使用角度js向API发出POST请求。我需要发送一些头文件和音频文件。 我已经在控制器中编写了相同的示例代码。通过角度发送POST请求发送音频数据JS
$scope.files='bostonSeltics.wav';
$scope.getText = function (access_token) {$http({method:'POST',
url:'https://api.att.com/rest/1/SpeechToText',
headers:{
'Accept':'application/json',
'Authorization':'Bearer '+access_token,
'X-SpeechContext': 'Generic',
'Content-Type':'audio/wav'},
data:$scope.files}).success(function(response){
......
}).error(function(error){
......
});
我只是想知道这是否正确的方法来发送音频数据。
在此先感谢。
问候, 磨憨