You must be logged in to post a comment.
1. Is there any way I can read request headers w/o reading body? This could be useful when handling large requests such as file uploading.
2. I haven't found any chunk related functions, which is useful when you don't know the size of data need to be transferred.
1. The socket will buffer the message as the message arrives. You provide the buffer and can control the maximum buffer size. async_read_request will "signalize" as soon as the headers are received, then you can handle requests elegantly. Even 100-continue is supported. This is a modern API (but still missing HTTP/2.0).
2. The message you receive are all treated on the same API, which supports chunking. The message you write can be delivered like a transaction, without using chunking, using async_write_response, or can be delivered using chunking, using async_write_response_metadata + async_write + async_write_trailers + async_write_end_of_message. You can check if chunking is supported using write_response_native_stream.