AlexanderMac / http-z

Parse/build HTTP message to/from model
MIT License
18 stars 6 forks source link

Transfer-Encoding: chunked ? #62

Closed jaswrks closed 7 months ago

jaswrks commented 9 months ago

Hi. Thanks so much for a great library. I can tell a lot of hours were put into this.

Just curious if you already support transfer-encoding: chunked for response parsing, or plan to add it in at some point later?

AlexanderMac commented 9 months ago

Hi, I'm glad that you like the library. The request/response parser supports any header, so you can use it right now:

HTTP/1.1 201 Created
transfer-encoding: chunked

Or did you ask about some specific functionality related to the header?

jaswrks commented 9 months ago

I was thinking about the numeric lines that get interspersed in the body whenever it's been chunked.

HTTP/1.1 200 OK
Content-Type: text/plain
Transfer-Encoding: chunked

7\r\n
Mozilla\r\n
11\r\n
Developer Network\r\n
0\r\n
\r\n

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

AlexanderMac commented 9 months ago

Got it. I'll add support for this feature soon.

AlexanderMac commented 7 months ago

Done, finally).