Curl command

Curl is an example of a third-party command line tool that you can use to post documents to Interchange. Interchange does not support retrieval of documents.

Curl is a client to get or send documents on a server using any of the supported protocols: HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP or FILE. The command works without user interaction or any kind of interactivity. Curl offers proxy support, user authentication, FTP upload, HTTP POST, SSL (HTTPS) connections, cookies, file transfer resume and more.

To use curl with Interchange, add a secure file message protocol bound to an embedded HTTP server to the community. The following are examples of posting files to Interchange with curl.

  • Post an X12 file – For the following command to work, configure the ep1 exchange point to parse EDI documents.
  • curl --header content-type:application/EDI-X12 --data @myfile.edi http://hostname:port/exchange/ep1
  • Post an EDIFACT file – For the following command to work, configure the ep1 exchange point to parse EDI documents.
  • curl --header content-type:application/EDIFACT --data @myfile.edi http://hostname:port/exchange/ep1
  • Optionally, the following can be included to avoid document parsing:
  • --header X-Cyclone-To:senderroutingid --header X-Cyclone-From:receiverroutingid
  • Post a XML file – For the following command to work, configure the ep1 exchange point to parse XML documents. Also, configure the XPath of sender and receiver in myfile.
  • curl --header content-type:application/xml --data @myfile.xml http://hostname:port/exchange/ep1
  • Optionally, the following can be included to avoid document parsing:
  • --header X-Cyclone-To:senderroutingid --header X-Cyclone-From:receiverroutingid
  • Post a binary file – In the following example, receiverroutingid is a routing ID of a configured partner.
  • curl --header from:receiverroutingid --header content-type:application/octet-stream --data @myfile.bin http://hostname:port/exchange/ep1
  • Optionally, the following can be included:
  • --header X-Cyclone- To:senderroutingid --header X-Cyclone-From:receiverroutingid
  • SSL
  • curl --header from:receiverroutingid --header content-type:application/octet-stream --data @myfile.bin https://hostname:port/exchange/ep1

Related topics

Related Links