views:

124

answers:

4

Hello,

I've been trying to find a Python code that would log in to my Yahoo account from "Google App Engine". One supporter on "StackOverflow" gave me this three-step plan:

  1. Simulate normal login and save login page that you get;
  2. Save POST&GET headers with "Wireshark";
  3. Compare login page with those headers and see what fields you need to include with your request;

The problem here is that I have never used "Wireshark" before. Plus, I don't know what the POST&GET headers are. Can You, please, explain it to me (preferably with some example). Thank You.

+2  A: 

Brief answer:

HTTP/1.1 has a few commands: GET, PUT, POST, DELETE, and a few others.

HTTP GET is used to retrieve a resource. ex GET http://www.demo.com/index.html

Wireshark is used to monitor network traffic. So, you can view all the HTTP commands that your machine is doing in real time.

In Wireshark find the specific POST command for your login page. This POST command has a lot of data in it including POST variables that are passed to the server. You can look at these variables and see what's going on to try and troubleshoot your situation.

I know that was very basic and short, but I think that was enough information to point you in the right direction.

http://www.wireshark.org/ http://wiki.wireshark.org/SampleCaptures http://en.wikipedia.org/wiki/POST_(HTTP)

Good luck!

Jonathan Mayhak
WOW!!! Jonathan, thank You for this info. I am studying it at the moment.
brilliant
+2  A: 

You should read up about HTTP-Requests in general first: wiki

Wireshark basically captures the entire data that runs through your network adapter - including the traffic from your browser. Now, you can see what exactly the browser sends to the webpage. If you have this information, you can go ahead and replicate the requests with the libraries Google provides.

Femaref
I see, Femaref, thank You for telling me that.
brilliant
+4  A: 

You don't need Wireshark, you need Firebug.

You should read up on Firebug on their wiki page. Take note that you're looking for parameters in GET or POST requests as such.

circles

Josh K
Firebug does headers now? Is there anything it doesn't do?
uncle brad
Yes. It can't scratch my back. I'm filing a bug report.
DVK
@ Josh K: Hello, Josh K !!!! Well, I do have the firebug already, but I still don't know how to do it. At first I was trying to use inspect button there (blue arrow-cursor on a whit-blue rectangle), but then I was advised to use the Net panel (the very last one on the bar, follows "DOM"), but in both cases I failed to find those headers by myself. Can You, please, tell me how I can do it there in the Firebug. Thank You.
brilliant
@brilliant: Editing my answer, stand by.
Josh K
brilliant
@ Josh K: Josh, thank You very much! I think I need to study that article on wiki first. Otherwise, I seem to ask stupid questions here and bother people too much. Thank You very much for this image and for this phrase: "Take note that you're looking for parameters in GET or POST requests as such."
brilliant
No, those are requests. The headers you're looking for are under each request in the "Headers" tab. You can also view what's been sent via POST / GET under "Params."
Josh K
@ Josh K: Aaah, I see!!! Thank You, Josh.
brilliant
+1  A: 

For monitoring header traffic in Firefox, I recommend LiveHTTPHeaders.

Danten
Hello, Danten, Thank You for this suggestion. I will firstly try my luck in Firebug, and if it doesn't go successfully, I will resort to LiveHTTPHeaders.
brilliant