Get some HTTP content without a browser: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
 
Line 1: Line 1:
For that we need to connect to the machine serving the pages, and input by hand the requests. In that situation everything is done manually and we need to be very precise with the requests. For example:
For that we need to connect to the machine serving the pages, and input by hand the requests. In that situation everything is done manually and we need to be very precise with the requests. For example:


* With the following, we will get a bad request error
* With the following, we will get a bad request error:
<source lang="bash">
<source lang="bash">
nc pzwart.wdka.nl 80
nc pzwart.wdka.nl 80
Line 9: Line 9:
EOF
EOF
</source>
</source>
* With the following, we will get a permanent redirection error
* With the following, we will get a permanent redirection error:
<source lang="bash">
<source lang="bash">
nc pzwart.wdka.nl 80
nc pzwart.wdka.nl 80
Line 17: Line 17:
EOF
EOF
</source>
</source>
* Finally the following GET is correct and will allow us to be served with right content
* Finally the following GET is correct and will allow us to be served with right content:
<source lang="bash">
<source lang="bash">
nc pzwart.wdka.nl 80
nc pzwart.wdka.nl 80

Latest revision as of 17:24, 12 January 2011

For that we need to connect to the machine serving the pages, and input by hand the requests. In that situation everything is done manually and we need to be very precise with the requests. For example:

  • With the following, we will get a bad request error:
nc pzwart.wdka.nl 80
GET /networked-media HTTP/1.1
Host: pzwart.wdka.nl

EOF
  • With the following, we will get a permanent redirection error:
nc pzwart.wdka.nl 80
GET /networked-media/index.php HTTP/1.1
Host: pzwart.wdka.nl

EOF
  • Finally the following GET is correct and will allow us to be served with right content:
nc pzwart.wdka.nl 80
GET /networked-media/ HTTP/1.1
Host: pzwart.wdka.nl

EOF