Set contentType in xhr

Enables application/json (for example) to be sent to the binary-producing HTTP endpoint.