Building an XMLHttpRequest manually

XMLHttpRequest is the safest and most reliable way to make HTTP requests.
To send form data with XMLHttpRequest, prepare the data by URL-encoding it, and obey the specifics of form data requests.