Added support for sending cookie and other headers