 #         be defaulted to application/json. Anything else will be send literally.
 #   headers: An object containing header key/value pairs
 #   cache: A boolean which will turn of jquery caching if using jquery, else ignored
+#   contentType: The content type of the request data. This will be set to "application/json; charset=UTF-8" if data is an
+#                object, which is the default case.
 #   dataType: Passed straight through to jquery ajax if using jquery, else ignored
 #   ajaxDelay: Introduce a fixed delay before resolving the request. Useful for testing async scenarios
 #   maxRetries: The number of times to retry a request that failed due to connectivity issues. Default 5


  try
    ajaxOptions =
      url: url
      headers: headers
      type: method
      data: data

      success: (data) ->
        resolveStatus(data)


          rejectStatus(error)


    if options.withCredentials == true
      ajaxOptions.xhrFields =
        withCredentials: true

    ajaxOptions.cache = options.cache if options.cache?
    ajaxOptions.contentType = contentType if contentType?
    ajaxOptions.dataType = options.dataType if options.dataType?

    request = $.ajax(ajaxOptions)

