@ianb asked:

> Why not `resolve(self.xhr)`? Now for instance you don't have access to the response headers.



The reason I'm being so redundant here is that I wanted to return simply a response value with no side-effects possible. The xhr object still has things like open() and send() methods all over it, and I don't want those to get out. That's why I'm just making copies of the text components of the result.

You're right, it's certainly true that for general-purpose use, all the response headers and stuff would also have to be in there. But I didn't need those yet, so I was just being lazy.