Angular 7 HttpClient post can not parse large request body?

Does angular HttpClient have limit on request body size?

I was doing an angular project that consumes a rest API. The API is simple, it’s just replace a JSON file whenever the API endpoint to the file hits using POST method, with new JSON object as the request body.

The code runs well if the new JSON object is small and only have some nodes, However the code returns an error with status code 400 and error message “Error when parsing request” when i’m trying to send big object. Does the error caused by the big object or am i doing it incorrectly?

Last time it returns error is when i tried to send big JSON file with ~1.5MB size, the JSON object seems to be valid as several online json formatters report it as a valid json object.

I’m sorry if i didn’t explain my problem well, as i’m not native english user, and i’m also quite new in angular world. Thanks

import { HttpClient, HttpHeaders, HttpErrorResponse } from "@angular/common/http";
import { take, catchError } from "rxjs/operators";
import { throwError, Observable } from "rxjs";
import { Injectable } from "@angular/core";

const headers = new HttpHeaders({
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Cache-Control': 'no-cache',
    'Access-Control-Allow-Origin': '*'
});

@Injectable()
export class configService {
    private _url = 'http://some-api-endpoint/';

    constructor(private http:HttpClient) { }

    private _save(data):Promise<any> {
        return this.http.post(this._url, data, { headers, responseType: 'text', observe:'response' })        
            .pipe(
                take(1),
                catchError(err => this._handleError(err))
            )
            .toPromise();
    }

    public async updateConfigFile(data): Promise<any> {

        try {
            const json = JSON.stringify(data, null, 2);
            const update = await this._save(json);
            if(update.status === 201) {
                return {
                    success: true,
                    data: update
                }
            } else {
                return {
                    success: false,
                    error: update
                }
            }
        } catch(err) {
            return {
                success: false,
                error: err.message
            }
        }        
    }

    private _handleError(error: HttpErrorResponse): Observable<never>{
        let errObj = {};
        if(error.error instanceof ErrorEvent) {
             const err = error.error
             console.warn('An client-side error occured:', {err});
             errObj = {
                 status: 'internal error',
                message: error.error.message
             }   
        } else {
             console.warn(`Backend returned code ${error.status} `, {error});
            errObj = {
                 status: error.status,
                 message: error.error
            }
        }

        return throwError(errObj);
    }
}

Source: New feed
Source Url Angular 7 HttpClient post can not parse large request body?