Stream API Error
hello to everyone, hope that somebody can help me.
i have a buffer video file and i want to upload to CloudFlare streams, this is the snippet:
let axios = require("axios").default;
console.log(video);
let options = {
method: 'POST',
url: 'https://api.cloudflare.com/client/v4/accounts/???????/stream',
headers: {
'Authorization': "Bearer "+process.env.CLOUDFLARE_API_VIDEO
},
body:{
file: video
}
};
axios.request(options).then((response)=>{
console.log(response);
}).catch((error)=>{
console.log(error.response.data);
});
the video variable is the buffer, but evety time i do the request the response is:
{
result: null,
success: false,
errors: [ { code: 10004, message: 'Decoding Error' } ],
messages: null
}
0 Replies