drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

HttpRequestPtr reset interface #2046

Open bethebest0622 opened 1 month ago

bethebest0622 commented 1 month ago

if i want to reuse the existed HttpRequestPtr.

I need to clear the header (the previous request needs header, but current request dont need).

I found there is no clearHeader interface.

RemoveHeader is not effectient, could you add this?

hwc0919 commented 1 month ago

Just a reminder, the HttpRequest object should only be reused after the previous request finished (technically it is safe to reuse after the previous request is sent, but we don't have a notification point there).