Request to upload file:
// upload file to the pre-signed url
const httpOptions = {
headers: new HttpHeaders({
'Content-Disposition': 'attachment;filename=' + file.name + '',
observe: 'response'
})
};
this.httpClient.put(preSingedUrl, file, httpOptions)
.subscribe((response: HttpResponse<any>) => {
console.log(response); // it's returning null
});
response is always getting null, but in the network tab status is 200 OK.
access-control-allow-methods: GET, POST, OPTIONS
access-control-allow-origin: *
content-length: 1207
content-type: application/json
date: Tue, 25 Jun 2019 07:38:06 GMT
status: 200
strict-transport-security: 'max-age=31536000'
x-amz-apigw-id: someid
x-amzn-requestid: someid
x-amzn-trace-id: Root=someid;Sampled=1
How to read the status 200 OK using angular 8.
