Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
ntcobol Absent Member.
Absent Member.

HTTPPOST to upload an XML file to a web form

I am trying to use HTTPPOST to upload an XML file via a web page. Content type needs to be multipart/form-data and it is posting to a form.


This works using Curl but I would like to do this in my program using HTTPPOST. Here is an example of the curl command that works:

curl --form user=USERNAME --form pass=PASSWORD --form uploadfile=@XMLFILE.xml URL


I'm not sure how to do this using HTTPPOST. Do I need to set the payload to match the body of the post or is there a better way?

I set a trace on curl and I can see the body of the post but it's a lot of information to hard code in a program.


Any help and advice would be great.

Thank you

Tags (2)
1 Reply
Micro Focus Expert
Micro Focus Expert

RE: HTTPPOST to upload an XML file to a web form

Based on other HTTPPOST forum articles, curl is the bast way to do this. see community.microfocus.com/.../rmnet-httppost-httpget
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.