Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So I've been really curious the past few days..
So when doing a HTTP GET & POST how does the code flow.

I kiiiinda get how it works but I would like to dig down and see how it works.
And so far I havent found any good blog posts or anything about it.

So I guess this is the first part.
This is how I think it flows.

1. Do a GET request and turn the AutoRedirect to false.
2. Wait for it to load and store the cookies you got.
3. Use those cookies to build up the POST request.
4. POST the encoded post DATA.
5. Check the request result.

There is probably alot of things I missed and that's why I need you guys.
What did I miss and what are some things to keep in mind when doing a let's say a Login HTTP GET & POST.

And in the first step
1. Do a GET request and turn the AutoRedirect to false.


What does it look like visually, like would it just look the same as when you type on https://Google.com in your webbrowser and then when the result is displayed is that the same?
Anyways, if you could please describe how this works because I find this topic very interesting.

What I have tried:

I've tried looking around for blog posts but couldn't find anything specific.
Posted
Comments
F-ES Sitecore 19-Mar-18 13:59pm    
Do you mean what does it look like when you do them from code? Google for an app called "Fiddler", it's free and lets you examine web traffic on your machine so you can compare how your requests look compared to your browser. What you'll find is that the browsing is adding a lot of headers to the request that you're not aware of, and unless you add the same headers your own requests will look a little more bare in comparison.
ItsMelissa 19-Mar-18 14:02pm    
So you need to mimic the Fiddler request?
And also, headers are cookies right?
Richard Deeming 19-Mar-18 14:36pm    
"headers are cookies right?"

No.

Headers are additional information set with the request and the response:
HTTP headers - HTTP | MDN[^]

Cookies are one of many things that headers are used for, using the Set-Cookie header in the response, and the Cookie header in the request:
HTTP cookies - HTTP | MDN[^]
F-ES Sitecore 19-Mar-18 19:44pm    
Fiddler just lets you see what the request and response looks like, it'll become obvious when you see it. If you want to mimic a browser request then Fiddler will show you want you need to send.
Graeme_Grant 19-Mar-18 20:21pm    
virtual 5'd! Love Fiddler - Free Web Debugging Proxy - Telerik[^] ... great debugging tool!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900