add sendRequest to wrap get, post request and internal redirection