如何解决试图将imgur api与angular一起使用
我正在尝试使用imgur api,但是每次都会出错
数据:{错误:“无效的client_id”,请求:“ / 3 / image /”,方法:“ POST”}
我确定客户端ID是正确的
我从这里得到
https://api.imgur.com/oauth2/addclient
这是我尝试过的
也尝试了此解决方案,但效果不佳 Use Imgur API with Angular4
onChange(event) {
this.uploadedImgData = event.target.files[0]
}
uploadImg() {
const formData = new FormData();
formData.append('image',this.uploadedImgData,this.uploadedImgData.name)
this.http.post('https://api.imgur.com/3/image/',formData,{ headers: new HttpHeaders({ "Authorization": "Client-ID change this" }) }
).subscribe((data) => {
console.log(data);
});
}
upload() {
this.uploadImg()
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。