如何将获取字节数组的post请求从Angular发送到Web Api?

如何将获取字节数组的post请求从Angular发送到Web Api?,angular,Angular,我的Web Api需要post请求中的字节[] 在Angular 2应用程序中,我有文件输入,我希望将其作为字节数组发送 <input type="file" (change)="onChange($event)" name="image"> onChange(event){ this.file=event.target.files[0]; 知道是否可以通过post请求发送字节[]吗 var payload = new FormData(); payload.append("na

我的Web Api需要post请求中的字节[]

在Angular 2应用程序中,我有文件输入,我希望将其作为字节数组发送

<input type="file" (change)="onChange($event)" name="image">

onChange(event){
this.file=event.target.files[0];
知道是否可以通过post请求发送字节[]吗

var payload = new FormData();
payload.append("name", file);