'Why angular httpClient PUT method send blank binary body to REST api (setup in aws api Gateway )?
Here is binary data I want to send as body
const file: File = event.target.files[0]
This is how I send it
const formData = new FormData()
formData.append("file", file,file.name);
this.http.put(url, formData, httpOptions).subscribe((result: any) => {
//
});
But in api log, I can't find the body data:
Endpoint request body after transformations:
This API is defined in AWS API gateway integrated with S3 PUT service, the curl or postman method worked well on it but in the website it doesn't work with blank body
I have tried send File data directly, but still same problem. Moreover this api has enable CORS. I wonder where this problem come from? API config or angular frontend?
angularamazon-web-services">
amazon-web-servicesamazon-s3">
amazon-s3aws-api-gatewayangular-httpclient
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
