added conditional JSON.stringify on send post data (if contentType is "application/json")