WEEK 3 NEW VOCABULARY
- Winnie Au and Balint Nemes
- Aug 5, 2015
- 2 min read
Some really exciting stuff this week! Every week we are learning a ton, but this week it's like we've been jettisoned into a different realm. We have hit the internet! Previously we were mostly focusing on our developing skills behind the scenes, but as someone in my cohort said, it's nice being able to create something that can actually be viewed on the internet. To guide us with this process, our coach has given us the assignment of researching the difference between GET and POST HTTP request methods. Here is what Balint and I have found (with some additional new terminology that seems helpful) using Wikipedia and other various sources:
Before delving into anything further, what is HTTP? I use the internet every day, and somehow I never managed to even look up the meaning. HTTP stands for Hypertext Transfer Protocol, and works as a request-response protocol to allow communication between a client (for example a web browser) and a server (for example an application running on a computer hosting a web site).
Some primary differences:
GET - Requests data from a specified resource
POST - Submits data to be processed to a specified resource
GET requests are generally used in "safe" actions, while POST requests are used in "unsafe actions." What does this mean? Let's break it down. Safe or "idempotent" actions are used "when the submission of the elements will not change the state of the application." On the otherhand "unsafe" actions, seem to be actions that can have adverse consequences if repeated. One instance of an unsafe action might be if a customer wants to make a purchase on the internet and submits a web form, they could make the purchase a second time without realizing it.
In the GET method, a query string which consists of name/value pairs, are sent in the URL like this:
/test/demo_form.asp?name1=value1&name2=value2
In the POST method, the query string is sent in the HTTP message body of a post, like this:
POST /test/demo_form.asp HTTP/1.1 Host: w3schools.com name1=value1&name2=value2
The above examples were taken from this site:
To get a more comprehensive idea of what HTTP requests are and the differences between GET and POST requests, I am including a few links that I found useful (including directly above)
Potentially helpful links:
Comments