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 trial
Dillon Reyna9,531 Points
What was the point of this?
What was the point of using a GET request to send data forward?
I understand how the following works
telnet httpbin.org 80
GET /get?food=sandwich&drink=water Host: httpbin.org
I just don't understand what this accomplishes, nor what use cases it could have.
Ari Misha19,323 Points
Hiya there! Understanding how HTTP works behind the scenes is everything. I mean consider HTTP a platform where all the important actions are taken. Lets just say you've an app and a resource name stock. It lives on remote servers. And a user visits your website and requests your server to get him/her a catalogue of everything thats stored in the stock. So whenever he'll interact with the website and make a request for the catalogue, a request is generated in form of GET request. Also this request will contain some information like what catalogue is user requesting. Its called Payload. You can actually read the request object in DevTools if you're curious. Now the server makes the request to the framework/back-end which routes it to controller and controller takes the request and get the appropriate information from the models and send it back to the server. Which in turn gets rendered (it could be a HTML or XML or jSON) and user recieves a response of 200 OK, which means everything went well and response was successful. This is one request-response cycle. It all happens in HTTP. Consider httpbin.org the resource and *food=sandwich&drink=water * the payload.
Using get request to send data is often used in a web forum to search a website. You can simulate this in your browser by typing things like stackoverflow.com/search?q=http or google.com/maps?q=chicago.
It has been mentioned in this section.