XHR helper functions for the browser