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

RE: Help consuming a REST webservice with HTTPAPI.



> You would just have two procedures for the two different additional headers you need.

The additional header support does not play well with more than one procedure. You should combine any additional headers in one procedure.

I think the base64 part of your question also needs to be fleshed out...Thinking out loud since I have not done this in practice. Make string, convert to ASCII, Base64 encode, convert back to EBCDIC, pass to the header (which will reconvert to ascii and send to your service which will decode the base64 string into ASCII).

Pseudo code:

    String = user + ':' + password;
    StringASCII = iconv(String);
    StringBase64 = Base64EncodingRoutine(StringASCII);
    StringBase64EBCDIC = iconv(String);
    HeaderData = 'Authorization: Basic ' + StringBase64EBCDIC + CRLF + 
                 'Account: ' + accountID + CRLF;

I see that Scott wrote an article about how to do Base64 using "built-in" functions for IBMi.
You might want to take a look. It looks like there is support for a "one-step" conversion.

http://iprodeveloper.com/application-development/base64-built-ibm-i

There are BASE64 routines in the "private" area of HTTPAPI. Previously, Scott cautioned against using them.

Scott wrote Base64 routines you can you use http://www.scottklement.com/base64/




-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------