feat(request): efficiently support empty headers

Replace std::string with a local buffer + manually managed
buffer on heap.