Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am currently using Angular 2.0 for client and Spring Boot for server side. Currently, I am facing an issue where client sends a post request to server and server sends a response as a json after 5 minutes and its a huge json. On the client side that is angular 2.0 , I am getting HPE_INVALID_CHUNK_SIZE and it gets closed. I have tried using the same http post request in postman and its works fine. Can you anyone please help me with this issue?

I got into similar troubles if I did not send proper Transfer-Encoding or Content-Length http headers. Solution for me was to either send Content-Length or ommit it and send Transfer-Encoding: chunked instead.

Generally speaking whenever I got HPE_INVALID_CHUNK_SIZE error while doing with JavaScript first I do is checking headers I am sending to server.

I would recommend to examine headers sent by POST man and compare them to those sent by your angular app.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding#Directives

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .