This must be already implemented somewhere we could just re-use ... any chance this already exists in http-kit?