@umutgur wrote:
Hello there,
I want send sound file to server with a post request, server side is a .net web api application.
I can send form datas, but how can send a sound file?
I wrote following codes for post request;
post(postModel: PostModel): Observable<Object> { let url: string = this.apiUrl + "/posts/record"; let formData: FormData = new FormData(); let headers = new HttpHeaders() .set('Authorization', btoa("user" + ":" + "password")); formData.append('userID', this.postModel.userID.toString()); formData.append('dateTime', this.postModel.dateTime); formData.append('text', this.postModel.text); console.log(postModel); return this.http.post(url, formData , { headers: headers }); }
How can do that?
Posts: 1
Participants: 1