在http

时间:2018-02-25 17:58:01

标签: node.js http post base64

我一直在尝试将我的图像作为base64字符串上传到amazon s3,但我的s3存储桶中的base64字符串已损坏。我的HTTP POST配置有什么问题,例如指定的内容类型?

var image = webcamImage.imageAsBase64;

const httpOptions = {
  headers: new HttpHeaders({
    'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
  })
};


this.httpClient.post("http://localhost:8888/upload", image, httpOptions).subscribe();

1 个答案:

答案 0 :(得分:1)

尝试将ContentEncoding更改为'base64',将ContentType更改为'image/jpeg'

相关问题