Ability to handle CORS

I've added withCredentials to the options, more info can be found here: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS