Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 392 Bytes

send-multipart-form-data-with-post-request.md

File metadata and controls

15 lines (12 loc) · 392 Bytes

Send multipart form data with post request

Below is the code to send a request with multipart/form-data in Angular 7.

  uploadData(data) {
    const headers = new HttpHeaders();
    headers.append('Content-Type', 'application/json');
    const requestOptions = {
      headers: headers
    };

    return this.httpClient.post(this.apiUrl, data, requestOptions).toPromise();
  }