In the web world there is now a HEAD verb that is similar to GET but returns meta data for an object, not the object.
Is there anyway to incorporate this into the library?
Kind Regards,
Dave
Creating a url_head routine
Re: Creating a url_head routine
Have you tried HTTP_req() ? It is not method specific.
-
- Posts: 4
- Joined: Tue Feb 06, 2024 3:39 pm
Re: Creating a url_head routine
I have seen it and am looking for some examples on how I might use it.
-
- Site Admin
- Posts: 872
- Joined: Sun Jul 04, 2021 5:12 am
Re: Creating a url_head routine
HEAD has existed since at least HTTP 1.0, which was released in 1996.
HTTP_req, HTTP_string, HTTP_stmf are all intended to work with any HTTP method.
here's a simple example (no idea what you're planning to do with HEAD, so not sure how helpful it is)
HTTP_req, HTTP_string, HTTP_stmf are all intended to work with any HTTP method.
here's a simple example (no idea what you're planning to do with HEAD, so not sure how helpful it is)
Code: Select all
**free
ctl-opt dftactgrp(*no) bnddir('HTTPAPI');
/copy HTTPAPI_H
dcl-s rc int(10);
dcl-s url varchar(1000) inz('https://www.scottklement.com');
dcl-s modified varchar(100);
rc = http_req( 'HEAD': url: *omit);
if rc <> 1;
http_crash();
endif;
modified = http_header('Last-Modified');
snd-msg 'Page last modified:' + modified;
*inlr = *on;