recode xhttp handler and define request method behaviour