Contributed by Anonymous Monk
on Jul 03, 2000 at 20:05 UTC
> network programming
I want to print to server the proper response headers for a
page fowared like a Location: http:www.yahoo.com and an
image send, like a gif. This is for a server that will parse
the header itself and send the client browser.
|Answer: From server send http response header directly to client.|
contributed by vaevictus
A good way to figure out what you need is to telnet to your favorite server which is already sending out similar data.
For example, if you can read the first 15 lines or so of it's response to a proper GET, that'll contain your header.
telnet www.perlmonks.org 80
Connected to www.perlmonks.org.
Escape character is '^]'
just incase you want a header to just display,
here's one for ya...
GET http://www.perlmonks.org/ HTTP/1.0
// you'll need to press Enter a few times until you get a return
HTTP/1.1 200 OK
Date: Tue, 29 Aug 2000 14:00:22 GMT
Server: Apache/1.3.12 (Unix) PHP/4.0.1pl2 mod_ssl/2.6.5 OpenSSL/0.9.5a
Last-Modified: Mon, 24 Jul 2000 13:28:52 GMT
to out put this to a client, you'd put a CR before and after the header, and start your code after the header.
Please (register and) log in if you wish to add an answer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||