erlhttp icon indicating copy to clipboard operation
erlhttp copied to clipboard

Accumulating the body

Open benoitc opened this issue 12 years ago • 2 comments

What do you mean by "The parser will automatically accumulate the request body. To clear the results of the request body, e.g. after writing to a file, call.". Aren't the body chunk returned chunk by chiunk if ewe pass the data to the parser? Why accumulating?

benoitc avatar Jul 11 '13 05:07 benoitc

Hi Benoit, I'm considering removing this as it can easily be done by the user of the library and might be confusing/unexpected.

The idea was to make it easy to read the whole body in a binary at once. If you read chunk by chunk you call clear_body_results after each chunk.

mme avatar Jul 19 '13 20:07 mme

Hi sorry for the delay to answer. imo read ing thefull body should be an extra method. Ie you could expose the api to fetch the body by chunk and provide a body(...) function to read all body. I can provides you a patch if you want.

benoitc avatar Aug 24 '13 10:08 benoitc