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

JavaScript Build a Simple Dynamic Site with Node.js HTTP Methods and Headers Redirection Headers in Node.js

Akash Sharma
seal-mask
.a{fill-rule:evenodd;}techdegree
Akash Sharma
Full Stack JavaScript Techdegree Student 14,147 Points

Is the 303 Redirection from Post to Get coming from the server itself or the still client?

The server will take the original post request from the form but then is it the now server sending itself a new request as a Get method with the query appended on?

1 Answer

Emmanuel Molina
Emmanuel Molina
9,268 Points

The 3 digits code is part of a response, never a request, so it's always sent by the server to the client. Inside the server there is no need to duplicate the request, just a rerouting, because GET or POST is just a parameter on how to deal with the data. The data itself isn't modified. The 303 in the response is meant to don't trouble the client, because he expected a page and got an other. He could throw an error. It's like you ask for a coffee and the waiter give you a tea without a word :)