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

Re: Enhancement request for HEADERR4 module



Hi Thomas,

My problem with this proposal is that it would really only work for the 
content-type header.  Each header has it's own structure, different from 
the others.

The existing http_header() routine is designed to return the string that 
corresponds to a given header.  It does not make an attempt to parse the 
string, because the structure of the different headers is dissimilar. 
If you need to break up the content-type, I suggest having a 
http_getContentType() routine (which certainly can be put in HEADERR4) 
that has logic specifically designed for the content-type header.



thomas.raddatz@xxxxxx wrote:
> 
> 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)!
> 
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------