add applyHeaders
support custom cookies