Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRyan Broughan
12,742 PointsDo I have to capitalize GET/POST?
I've been typing GET and POST in lowercase, but when I did the code challenge, it wouldn't let me move forward with until I capitalized my "get".
Is this a style thing or a best practice?
2 Answers
Daniel Newman
Courses Plus Student 10,715 Pointshttp://stackoverflow.com/questions/7790576/what-are-http-method-capitalization-best-practices
Both methods (GET/POST) is based on HTTP protocol headers property name, as you know: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#open() http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
So, we should use uppercase just to avoid implementation flaws in JS. And we should keep the XHTML standards too and make it lowercase in HTML forms.
It's just two different standards.
http://stackoverflow.com/questions/4106544/post-vs-post-get-vs-get
Abhishek Bhardwaj
3,316 Pointsyes you have to capitalize both GET/POST.
Ryan Broughan
12,742 PointsRyan Broughan
12,742 PointsLet me get this straight--for BOTH the html form element and the xhr.open it should be in caps(ex: "GET")? But historically, you used lowercase for xhtml including form elements?
Daniel Newman
Courses Plus Student 10,715 PointsDaniel Newman
Courses Plus Student 10,715 Pointscheck updated answer version