support for headers and body, beginning of connect middleware