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

RE: Enhancement request for HEADERR4 module




Yes, you are right. Here is a snipped taken from a simple test program. It
shows how it could look like, given that Scott confirms the new procedures.

// produce some headers
header_parse('HTTP/1.1 200 OK' + CRLF +
             'Server: Apache-Coyote/1.1' + CRLF +
             'Content-Type: text/html;' + CRTAB +
                  'charset=ISO-8859-15' + CRLF +
             'Date: Mon, 30 Mar 2009 15:02:30 GMT' + CRLF +
             'Transfer-Encoding: chunked' + CRLF +
             'Proxy-Connection: Keep-Alive' + CRLF +
             'Connection: Keep-Alive' + CRLF + CRLF: *NULL);

// get the content type
contType = http_header_value('content-type');
assert(contType = 'text'
       : 'Unexpected content type: ' + contType);

// get the content sub type
contSubType = http_header_sub_value('content-type');
assert(contSubType = 'html'
       : 'Unexpected content sub type: ' + contSubType);

// everything is fine if we reached that point


Thomas.


ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 30.03.2009 17:31:26:

> Thomas,
>
> Your addition would make it more convenient to retrieve any header
> value directly? I am for having that in HTTP API.
>
> Mike Krebs
>
> > -----Original Message-----
> > From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> > bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of thomas.raddatz@xxxxxx
> > Sent: Monday, March 30, 2009 6:21 AM
> > To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Enhancement request for HEADERR4 module
> >
> >
> >
> > Hi,
> >
> > For WSDL2RPG I need some new procedures to get the "main" and "sub"
> > header
> > value from a given header in the header list. I also need a procedure
> > to
> > get a specific header attribute of a given header. Is someone
> > interested in
> > these procedures? If so, please let me know and I will add them to HTTP
> > API. Otherwise I will add them only to WSDL2RPG.
> >
> > Sample header value:
> >
> >   Content-Type: text/html; charset=ISO-8859-15
> >
> > Return values of the procedures:
> >
> >   http_header_value('content-type': 0)           ==> text
> >   http_header_sub_value('content-type': 0)       ==> html
> >   http_header_attr('content-type': 0: 'charset') ==> ISO-8859-15
> >
> > Syntax:
> >
> >   string = http_header_value(name: [pos])
> >   string = http_header_sub_value(name: [pos])
> >   string = http_header_attr(name: [pos]: attrName)
> >
> > Return values are without quotes (in case of quoted values)!
> >
> > Regards,
> >
> > Thomas.
> >
> >
> > --
> > IMPORTANT NOTICE:
> > This email is confidential, may be legally privileged, and is for the
> > intended recipient only. Access, disclosure, copying, distribution, or
> > reliance on any of it by anyone else is prohibited and may be a
> > criminal
> > offence. Please delete if obtained in error and email confirmation to
> > the sender.
> > -----------------------------------------------------------------------
> > 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
> -----------------------------------------------------------------------


--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------