[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perform a "HEAD" operation



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hannes,

The parameter list is the same as for the Unix write() procedure. You can
find the prototype in HTTPAPIR4, procedures recvdoc() and recvchunk():

     D saveproc        PR            10I 0 ExtProc(peProcedure)
     D  fd                           10I 0 value
     D  data                           *   value
     D  length                       10I 0 value

Of course you have to drop the "ExtProc" keyword for your procedure. The
Unix write() procedure is documented in the iSeries Information Center:

http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp

Search for "unix type apis" and click on "UNIX-Type apis - IBM". Then
follow the link "Integrated File System APIs" and proceed to "write()
(Write to Descriptor)":

 ssize_t write
   (int file_descriptor, const void *buf, size_t nbyte);


Thomas.

Am 30.06.2014 17:16, schrieb Hannes Rosner:
> Hello Scott.
> 
> I could not find a description how the parameter list for a Proc 
> "peSaveProc" must look like.
> 
> Hannes
> 
> -----Ursprüngliche Nachricht----- Von:
> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Scott
> Klement Gesendet: Montag, 30. Juni 2014 17:00 An: HTTPAPI and FTPAPI
> Projects Betreff: 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 = '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:
>> 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 
> -----------------------------------------------------------------------
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQEcBAEBAgAGBQJTsa51AAoJELxuAUPiYRU8PIMH/2Hrtdxa7CsY9HGNdXho2Kmq
uukHfeyEHZVDoXUwY1aHwYtYWJ2XIQYXp5Z76RU8SvLFDpmbu2zEKQSxcsZ6l7hm
d3LhJ8K7NYDi8/gyxnQomCARqJjcvdvSToN10LUZscw3RmSa193NHXbpDWXCq22y
+t+fFlR2kAD68sgllFiLDR3wQ3jGxzpra24g6k9cNcsDVafof7/VHBLI2wJzSkEa
4PTqGIWviuVUd+bUe+jpjDSqd4HcriG21a1Ovxc8yk41L5b2py2cBJsPBSku0UAd
8yd/sPXERjNo7WR8kxwByvh1C5foaONVXd2Xaksq5wfLTMlKoHerg6ew3rUM4GU=
=v69G
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------