You would use GET when the request is idempotent, meaning that multiple requests generate the same result. In general use GET to retrieve data from the server, in other words try to change the state on the server with a GET call. Use POST methods anytime you are changing the state on the server with a GET call. In POST you are required to set the content-Type header on the XMLHttpRequest.
It is used to exchange data with a server behind the scenes.