content type setting

content type setting

  1. $.ajax({
  2. url:url,
  3. contentType:"foo"
  4. })

  1. $.ajax({
  2. url:url,
  3. headers:{
  4. content-type:"foo"
  5. }
  6. })

what is the differences between the two code snippets?