Get some HTTP content without a browser: Difference between revisions
(Created page with "For that we need to connect to the machine serving the pages, and input by hand the requests. <source lang="bash"> nc pzwart.wdka.nl 80 GET /networked-media HTTP/1.1 Host: pzwar...") |
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. | 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 | |||
<source lang="bash"> | <source lang="bash"> | ||
nc pzwart.wdka.nl 80 | nc pzwart.wdka.nl 80 | ||
Line 8: | Line 9: | ||
EOF | EOF | ||
</source> | </source> | ||
* With the following, we will get a permanent redirection error | |||
<source lang="bash"> | |||
nc pzwart.wdka.nl 80 | |||
GET /networked-media/index.php HTTP/1.1 | |||
Host: pzwart.wdka.nl | |||
EOF | |||
</source> | |||
* Finally the following GET is correct and will allow us to be served with right content | |||
<source lang="bash"> | |||
nc pzwart.wdka.nl 80 | |||
GET /networked-media/ HTTP/1.1 | |||
Host: pzwart.wdka.nl | |||
EOF | |||
</source> | |||
[[Category: Cookbook]] |
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