HttpErrorResponse 200 after successfull POST in Angular

后端 未结 2 937
感动是毒
感动是毒 2021-01-13 02:40

I upload one file from Angular 5.xx to Jersey 1.xx via FormData.

The data gets received and saved successfully on my server app directory, but Browser says this line

2条回答
  •  执笔经年
    2021-01-13 03:34

    Try to actually send a JSON response, or tell angular to expect something different. If you're using HttpClient, it will by default expect JSON.

    Something like this:

    this.http.post(url, body, { responseType: 'text' }).subscribe();
    

提交回复
热议问题