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

Re: HTTPAPI 1.11 pre-release - truncating data on a POST



That worked like a charm, thanks!
I actually have three variable that I need to send to my vendor. The first 2 are short and the 3rd one is long.
I tried it using http_url_encoder_addvar() for all three. Successfully!
I also tried it using http_url_encoder_addvar_s() for the first 2, and http_url_encoder_addvar on the 3rd. Successfully!
 
Is there any advantage to using one over the other, Other than simplicity?

Hi Eric,

> I am missing the following from the end of input
>         </DATA>' +
>         '<DATA type="demographic" id="58112">CV</DATA>' + CRLF
>         '<DATA type="extra" id="trigger">yes</DATA>' + CRLF +
>         '</DATASET>' + CRLF;

The HTTP_url_encoder_addvar_s() routine can only handle an input value of
256 characters or less.  Note the prototype:

       D http_url_encoder_addvar_s...
       D                 PR             1N
       D    peEncoder                        like(HTTP_URL_ENCODER) value
       D    peVariable                 50A   varying value
       D    peValue                   256A   varying value

See how the last parameter is 256A?  That means it'll truncate anything
longer than that.

There's another API called http_url_encoder_addvar() that's not limited in
length (but unfortunately is slightly more cumbersome to use -- that's why
addvar_s was added in fact, it was to simplify things somewhat)

Try changing your code so that it looks like this:

c                   callp     http_url_encoder_addvar( Enc
c                                                    : 'input'
c                                                    : %addr(ApiInp)+2
c                                                    : %len(ApiInp) )

That version of the code does not have the same length restrictions.
Please let us know if this works, or if it doesn't.

Thanks
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------