Skip to main content

Hello, i send json data with curl z/os using rexx bpxwunix.

1) the json is accepted if i put the data  1047 encoded into an untaggged file  using --data @/filexxxx . but i do not want to use files for this

2) A  trace shows me if i put the same bytes  into stdin stem in  rexx (using --data @-  its not converted, so the server does not accept the garbage sent.

I am using an older version of curl, but i found no hint that a newer version will  help here??

Any ideas? I could build into the rexx my own translation table to convert the stdin data to 8859-1. but can i avoid it somehow?

Thank you 



------------------------------
Horst Gfrerer
RAITEC GmbH
------------------------------

Hello, i send json data with curl z/os using rexx bpxwunix.

1) the json is accepted if i put the data  1047 encoded into an untaggged file  using --data @/filexxxx . but i do not want to use files for this

2) A  trace shows me if i put the same bytes  into stdin stem in  rexx (using --data @-  its not converted, so the server does not accept the garbage sent.

I am using an older version of curl, but i found no hint that a newer version will  help here??

Any ideas? I could build into the rexx my own translation table to convert the stdin data to 8859-1. but can i avoid it somehow?

Thank you 



------------------------------
Horst Gfrerer
RAITEC GmbH
------------------------------

i tried to bpxwunix iconv my json text from a rexx stdin stem   to 8859-1 stdout stem (seems ok)

the length of the converted  json string is 471 byte

stem stdout.1 is 471 bytes long 

last 4  bytes hex  7D0A200A

this is used as stdin input in curl  --data-binary @- 

in the trace data is see my ascii data.  but one byte more (472) bytes are sent, an additional  hex 15 char  is added. why is this? the json parser says "unable to convert the JSON to an object"

trace data 

=> Send  , 472 bytes (0x1d8)       

01d0: 20 7d 0a 7d 0a 20 0a 15                          }.}. ..    

is there an explanation for this anomaly? thanks 



------------------------------
Horst Gfrerer
RAITEC GmbH
------------------------------

i tried to bpxwunix iconv my json text from a rexx stdin stem   to 8859-1 stdout stem (seems ok)

the length of the converted  json string is 471 byte

stem stdout.1 is 471 bytes long 

last 4  bytes hex  7D0A200A

this is used as stdin input in curl  --data-binary @- 

in the trace data is see my ascii data.  but one byte more (472) bytes are sent, an additional  hex 15 char  is added. why is this? the json parser says "unable to convert the JSON to an object"

trace data 

=> Send  , 472 bytes (0x1d8)       

01d0: 20 7d 0a 7d 0a 20 0a 15                          }.}. ..    

is there an explanation for this anomaly? thanks 



------------------------------
Horst Gfrerer
RAITEC GmbH
------------------------------

Hi Horst,

There was a bug in curl 7.52.1 and earlier versions: "Curl 7.52 reads extra '\\x15' bytes from MVS data sets." This issue was fixed starting from curl-7.52.1-b008.
The problem you described sounds similar, but it may not be the same.

Could you let me know which version of curl you're currently using?

Also, could you try updating curl? Or could you provide an example of the REXX script you're using - specifically, how you're transferring stdout from the first command to stdin of the curl command?

Thanks,
Sergey



------------------------------
Sergey Rezepin
Rocket Software
------------------------------

Hi Horst,

There was a bug in curl 7.52.1 and earlier versions: "Curl 7.52 reads extra '\\x15' bytes from MVS data sets." This issue was fixed starting from curl-7.52.1-b008.
The problem you described sounds similar, but it may not be the same.

Could you let me know which version of curl you're currently using?

Also, could you try updating curl? Or could you provide an example of the REXX script you're using - specifically, how you're transferring stdout from the first command to stdin of the curl command?

Thanks,
Sergey



------------------------------
Sergey Rezepin
Rocket Software
------------------------------

Hello Sergey, thanks!!

its curl 7.52.1. so  an upgrade is overdue. this issue is a reminder to not use an old version when starting a new project 

Horst



------------------------------
Horst Gfrerer
RAITEC GmbH
------------------------------