cURL / Mailing Lists / curl-users / Single Mail

curl-users

Using curl https to Post Fixed-Length Text Data -- Unable to Get Response Data

From: Rob Moretti <rob_at_mfals.com>
Date: Thu, 19 Apr 2007 17:36:05 -0700

Hello curl users,
 
I am trying to use the curl command line on our AIX system to send a
fixed-length text file to be processed by the remote server and get a
response file. We've used curl in the past successfully to perform API's
with various third parties, where the format of the data is XML. Here, the
data must be in fixed-length format (please don't ask why), and after much
trial and error, we (myself and the tech person at the receiving company --
we'll call them XYZ Company) were able to get my file to be successfully
sent and processed -- I just can't get the response file that I know is
being created.
 
This is an https post using a certificate file. Here is the format of the
curl command that I am using (sensitive parts of this command line have been
altered here for security reasons):
 
curl <https://cert.xyzcompany.com:99999> https://cert.xyzcompany.com:99999
--cacert "certfile.txt" -k --max-time 300 -H "User-Agent:" -H "Host:" -H
"Pragma:" -H "Accept:" -H "Content-Length:" -H "Content-Type:" -H "Expect:"
--data-binary "@myinputfile.txt" > myoutputfile.txt
 
In our previous uses of curl (both for http and https), similar commands
always result with the export from the remote server being stored in
myoutputfile.txt on my local system. In this case, I get nothing in
myoutputfile.txt, even though I know that myinputfile.txt is being sent and
processed on the remote server, and an output file is being created on the
remote server.
 
I tried some variations of this command as follows:
 
a) used -o "myoutputfile.txt" instead of > myoutputfile.txt
b) included -i option (include HTTP header in the output)
 
The -i option did cause a one-line HTTP header to be saved in
myoutputfile.txt. The content of this file was:
 
HTTP/1.1 200 OK

With the -i option, the results were the same for both forms of output file
specification as shown in (a) -- I got the same one-line HTTP header as
shown above, so I know that either syntax in (a) does cause data to be
routed correctly to myoutputfile.txt -- I just can't get the actual response
data! NOTE: Like the input data, the response data is fixed-length text,
not XML. My tech contact at XYZ Company is pretty sure that everything is
set up correctly on their end, although this is apparently the first
instance where they are setting up a curl connection for exchanging
fixed-length data.
 
Can anyone recommend a solution or other options to try?
 
Thanks!
 
-Rob
 
Received on 2007-04-20