Ajax Post + Django

Last update on March 20, 2015.

When using $.ajax post you must be careful of what you set as contentType option. If you set it as 'application/json' you will have to parse the data from the request.BODY variable in your django class based view. The request.POST variable (Querydict) will be empty. It is better to not use the contentType option as the default will work fine.

contentType (default: 'application/x-www-form-urlencoded; charset=UTF-8') Type: String

When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server

Next entry

Previous entry

Similar entries

Comments

Comments are closed.

Pingbacks

Pingbacks are open.

Trackbacks

  1. real racing 3 hacks on 03/20/2015 11:42 p.m. #

    Ajax Post + Django

  2. wedding photography packages on 03/21/2015 12:58 a.m. #

    Ajax Post + Django

  3. trail tech voyager on 03/21/2015 4:13 a.m. #

    Ajax Post + Django

  4. Online life Experience degree on 03/24/2015 9:50 p.m. #

    Ajax Post + Django

  5. Emergency Roof Repair bronx on 03/25/2015 6:51 p.m. #

    Ajax Post + Django

  6. Tree Gator watering bags on 04/24/2015 1:59 p.m. #

    Ajax Post + Django

  7. carpet odor on 05/07/2015 7:36 a.m. #

    Ajax Post + Django

  8. Garcinia Cambogia on 05/08/2015 4:59 p.m. #

    Ajax Post + Django

  9. mobile engineer jobs on 05/25/2015 11:53 p.m. #

    Ajax Post + Django

  10. website on 05/26/2015 10:23 p.m. #

    Ajax Post + Django

  11. check out my site here on 06/18/2015 10:09 a.m. #

    Ajax Post + Django

  12. Our Small Blog on 06/22/2015 9:35 a.m. #

    Ajax Post + Django

  13. visit the following web site on 07/01/2015 1:53 a.m. #

    Ajax Post + Django

  14. รับจ้างทําเว็บราคาถูก on 07/05/2015 6:10 a.m. #

    Ajax Post + Django

  15. click on 07/09/2015 7:10 a.m. #

    Ajax Post + Django

  16. ray ban 2140 on 07/18/2015 8:42 p.m. #

    Ajax Post + Django

  17. voyance gratuite on 07/19/2015 11:05 a.m. #

    Ajax Post + Django

  18. gafas de sol ray ban 2014 on 08/06/2015 11:56 p.m. #

    Ajax Post + Django

  19. moncler polo shirt on 10/31/2015 7:55 a.m. #

    Ajax Post + Django

  20. Moncler Daunenjacke Damen Outlet on 11/11/2015 7:42 p.m. #

    Ajax Post + Django

  21. Moncler Schweiz on 11/15/2015 7:48 p.m. #

    Ajax Post + Django

  22. Sell Auto Notes on 01/04/2016 3:03 p.m. #

    Ajax Post + Django

  23. Sell BHPH Notes on 01/15/2016 1:32 p.m. #

    Ajax Post + Django

  24. Read the Full Write-up on 01/21/2016 7:48 a.m. #

    Ajax Post + Django

  25. seo uk on 02/28/2016 11:23 p.m. #

    Ajax Post + Django

  26. annuaircredit on 04/01/2016 12:43 p.m. #

    Ajax Post + Django

  27. Changer de banque on 04/06/2016 11:08 p.m. #

    Ajax Post + Django

  28. http://wackyintrospect19.skyrock.com/ on 04/10/2016 4:38 a.m. #

    Ajax Post + Django

  29. Transition management on 04/11/2016 7:47 a.m. #

    Ajax Post + Django

  30. Teamwork Coaching on 04/12/2016 6:38 p.m. #

    Ajax Post + Django

  31. such a good point on 04/14/2016 6:53 a.m. #

    Ajax Post + Django

  32. bandar bola on 04/21/2016 8:30 a.m. #

    Ajax Post + Django

  33. pay per click marketing strategy on 04/21/2016 3:23 p.m. #

    Ajax Post + Django

  34. clash royale gratuit on 04/22/2016 2:41 p.m. #

    Ajax Post + Django

  35. see more on 04/23/2016 8:37 a.m. #

    Ajax Post + Django

  36. goal on 04/23/2016 7:47 p.m. #

    Ajax Post + Django

  37. visit this backlink on 04/23/2016 8:29 p.m. #

    Ajax Post + Django

  38. what men want to hear on 04/24/2016 1:51 a.m. #

    Ajax Post + Django

  39. agen sbobet on 04/30/2016 9:07 a.m. #

    Ajax Post + Django

  40. best paid survey sites on 04/30/2016 9:22 p.m. #

    Ajax Post + Django

  41. email extractor 3.4.0 on 05/05/2016 11:12 p.m. #

    Ajax Post + Django

  42. how to get instagram followers on 05/06/2016 8:14 a.m. #

    Ajax Post + Django

  43. killer deal on 05/15/2016 2:40 a.m. #

    Ajax Post + Django

  44. German Shepherd Owners Guide on 05/12/2017 1:42 p.m. #

    Ajax Post + Django

  45. dollyparadise.dollsky.com on 05/16/2017 9:39 p.m. #

    Ajax Post + Django

  46. cheap volleyball jersey on 05/17/2017 2:37 p.m. #

    Ajax Post + Django

  47. amatör türk porno on 06/05/2017 3:48 a.m. #

    Ajax Post + Django

  48. the k park văn phú on 06/06/2017 4:15 a.m. #

    Ajax Post + Django

  49. the k park hà đông on 06/13/2017 1:13 p.m. #

    Ajax Post + Django

  50. trace phone numbers on 06/15/2017 8:15 p.m. #

    Ajax Post + Django

  51. Agen Poker Online Indonesia on 06/16/2017 1:15 a.m. #

    Ajax Post + Django

  52. youtu.be on 06/18/2017 1:15 a.m. #

    Ajax Post + Django

  53. Agen Poker Online Indonesia on 06/18/2017 5:42 p.m. #

    Ajax Post + Django

  54. hồ sơ đăng ký nhãn hiệu on 06/18/2017 10:07 p.m. #

    Ajax Post + Django

  55. https://www.facebook.com/?sk=welcome on 06/19/2017 9:29 p.m. #

    Ajax Post + Django

  56. Tablets and E-Readers on 06/23/2017 2:07 p.m. #

    Ajax Post + Django

  57. how to get criminal records free on 06/27/2017 9:07 p.m. #

    Ajax Post + Django

  58. the k park văn phú on 06/28/2017 3:20 a.m. #

    Ajax Post + Django

  59. locate a person for free on 06/28/2017 8:47 a.m. #

    Ajax Post + Django

  60. the k park on 07/01/2017 10:43 p.m. #

    Ajax Post + Django

  61. the k park văn phú on 07/02/2017 4:42 p.m. #

    Ajax Post + Django

  62. choicecomputertechnologies.Com on 07/17/2017 7:07 a.m. #

    Ajax Post + Django

  63. Matt Dooley Jersey on 07/28/2017 5:22 p.m. #

    Ajax Post + Django

  64. unlimited web Hosting reviews on 07/30/2017 1:38 p.m. #

    Ajax Post + Django

  65. Http://www.giaobanchungcumoi.info on 09/09/2017 2:21 a.m. #

    Ajax Post Django

  66. www.muachungcuvn.info on 09/09/2017 7:39 a.m. #

    Ajax Post + Django

  67. Main Poker Online on 09/13/2017 8:44 a.m. #

    Ajax Post + Django

  68. Agen Poker Online Indonesia on 09/14/2017 7:37 a.m. #

    Ajax Post + Django

  69. Business Computers on 09/14/2017 10:02 a.m. #

    Ajax Post Django

  70. muabanchungcumoi24h.info on 09/16/2017 1:56 a.m. #

    Ajax Post + Django

  71. Poker Uang Asli on 09/17/2017 9:17 p.m. #

    Ajax Post + Django

  72. vocational education on 09/21/2017 6 a.m. #

    Ajax Post Django

Trackback URL