HTTP coding of Last-Modified requests?

I need to write a small app that checks the Last modified date of a web
page and have read. So, having read the HTTP reference docs it seems that
opening a TCP/IP connection and issuing an HTTP request is the way to do
it. I'm a little confused though...

The docs say that a request should be issued in the following format:

   FullRequest       =     Method URI ProtocolVersion CrLf
                                [*<HTRQ Header>]
                                [<CrLf> <data>]

where  <HTRQ Header>     =     <Fieldname> : <Value> <CrLf>

Some questions:

1)  Is the method to be used GET or HEAD?

2) Is the ProtocolVersion required?

3) The "Last-Modified" fieldname is part of the HTRQ Header? Since I'm
asking for the date, what would be put in the "Value" part of the HTRQ
Header?

4) And finally, does the HTRQ Header come AFTER the CrLf indicated on the
1st line of the Full Request above (with it's own CrLf following)?

I realize this is a long set of questions, but if someone can give me an
example of the text stream to be sent out, one line could show me how it's
done...

For example, if I want to find out if the page at "www.page.com/index.html"
had changed, would the following work?

a) Open a connection to www.page.com.

b) Issue the following text (without the quotes) for the request:

"HEAD /index.html HTTP/1.0 CrLf Last-Modified : CrLf"

So, if you can tell me if the procedure above is correct (or what is if it
isn't) and any other things to take into consideration, I'll be very
grateful.

Thanks,

Steve

Received on Wednesday, 29 May 1996 12:13:58 UTC