1

If the posted message is too large, say either larger than m MB or n entries, then the server will respond with 413 Request Entity Too Large. I should be able to divide the data into smaller chunks and re-POST it.

I researched about multi-part request. Typically, all the examples use files to upload the data. How do I go about creating multiple chunks out of my payload? Currently, my code uses the httplib2 library. Illustration with example input will be helpful.

ndmeiri
  • 4,979
  • 12
  • 37
  • 45
user3662599
  • 63
  • 1
  • 1
  • 5
  • 1
    Dividing your post into smaller chunks will not help unless the receiving application was written to deal with that. The error you're receiving seems to be just the Web server telling you that your post size is greater than its configured max post size. What kind of data are you posting? image? – junnytony Jul 28 '15 at 23:27
  • Thanks for your response @junnytony. receiving multiple small chunk is agreed upon between client and server side.. Data is xml – user3662599 Jul 29 '15 at 00:30
  • @junnytony Thanks for your helpful comment! Several resources online suggest that chunking a request will fix a _413 Request Entity Too Large_ error. Your comment explained what was not mentioned in those online resources: chunking will not bypass the max post size limit imposed by the server. The first paragraph of [this answer](https://stackoverflow.com/a/13424453) confirms that your comment applies to (at least) nginx. "nginx 'fails fast' when the client informs it that it's going to send a body larger than the client_max_body_size by sending a 413 response and closing the connection." – ndmeiri Feb 13 '18 at 22:15

0 Answers0