[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Perform a "HEAD" operation
Hello Hannes,
I suspect that you are receiving the -1 because you've specified *NULL
for the peSaveProc. I don't think HTTPAPI allows this to be null. Can
you try specifying a procedure for this? You can write a procedure
that simply returns the length, but discards the data.
If that does not work, then please post a debug/trace file.
Good luck
On 6/30/2014 9:45 AM, Hannes Rosner wrote:
I want to perform a "HEAD" operation to get only the header information
back.
The idea is just to check if the object ( in this case: a picture)
exists on the server.
The way I try to do this is:
- http_persist_open()
- http_persist_req()
- http_persist_close()
Testing with
URL = '[1]http://www.wikipedia.de/img/logo.png';
wwComm = http_persist_open( URL );
rc = http_persist_req(`HEAD' :wwComm :URL :0 :*NULL :*NULL :0 :0 :*NULL
);
Will return rc= -1 ,but the debug log shows: "HTTP/1.1 200 OK"
My questions are:
- Can I do:
rc = http_persist_req(`HEAD' :wwComm :URL :0 :*NULL :*NULL :0 :0 :*NULL
);
To receive a return code "200" if the object exists.
And to get additional header information:
wrkHeaderInfo = http_header(`Name:');
- Or do I have to define the parameters "peSaveFD" and
"peSaveProc" to the http_persist_req() ?
And if yes, how should the parameter list for the "peSaveProc" look
like?
Any help and example is appreciated.
Hannes
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[2]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://www.wikipedia.de/img/logo.png
2. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------