Methods and Parameters Solution – Web Development

Articles, Blog

Methods and Parameters Solution – Web Development

Methods and Parameters Solution – Web Development


The answer is: it’s after the HTTP request headers. Let me show you how to find that out. So first we’ll go to our Editor and we’ll switch these lines around again so we can see the actual request. So I comment these two guys out, and I uncomment these two guys–this is what we’ve been doing before. Let’s go back to our browser–okay, let’s give it a shot. We’re going to reload this page, which is going to ask us if we want to resubmit the form. We’ll do so–aha! And now we see our HTTP request. This time it’s a POST instead of a GET. That’s because we changed the method to POST. We see more headers–we actually see a couple of these headers twice. That’s kind of a side effect of the fact that we’re not printing the actual request. We’re printing the Python representation of the request, which is a little glitchy–not a big deal. We can see here, after all of the headers, we have some data: q=some+words–that’s what I typed in my form. Remember, spaces get turned into pluses. So one of the big differences between GETs and POSTs is that GETs include parameters in the URL and POSTs include the data in the request body.

Leave a Reply

Your email address will not be published. Required fields are marked *