error MCH1210 in HTTPAPIR4 Len = -1

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
juan11de14
Posts: 9
Joined: Mon May 08, 2023 3:50 pm

error MCH1210 in HTTPAPIR4 Len = -1

Post by juan11de14 »

Hi,
I access the command line and consume a service without any problems as follows:
response = http_string( 'POST': URL: SOAP: 'text/xml')
But if I do it this way, by first making a post:
data-gen reqds %data(request) %gen('YAJLDTAGEN')
response = http_string('POST':url:request:'application/json');
Next in other program
response = http_string( 'POST': URL: SOAP: 'text/xml')
and it shows me the error MCH1210 en HTTPAPIR4 ( %len(resultstr) = Len;)
because Len = -1.
What caused this error?
ronny45
Posts: 11
Joined: Wed Sep 24, 2025 7:52 pm

Re: error MCH1210 in HTTPAPIR4 Len = -1

Post by ronny45 »

I'd recommend first setting debug options before calling http_string:

Code: Select all

http_debug(*on: '/tmp/httpdebug.txt');
and review the log written int text file.
Scott Klement
Site Admin
Posts: 945
Joined: Sun Jul 04, 2021 5:12 am

Re: error MCH1210 in HTTPAPIR4 Len = -1

Post by Scott Klement »

Are you up-to-date on HTTPAPI? There was a bug like this a couple of years ago...

If you are already running version 1.52 of HTTPAPI and still receiving this error, please tell us how to reproduce the problem on our machines.
Post Reply