Updated xhr parameters.

Added `application/json` header.
Converted data to JSON string.