Testing HTTP POST

There are several ways to test HTTP Post requests, depending on the available tools, expertise and preference of the user. Postman for example could be used if a tool with a graphical user interface is preferred. Another option is to use cURL. cURL is a command line tool and is available for almost every operating system. Curl can be downloaded from http://curl.haxx.se/dlwiz/?type=bin.

In the example below the file request.xml contains the optional request body and the response will be written to the file response.xml. To send a request without the optional request body, remove arguments --data-binary @C:\request.xml.

curl --data-binary @c:\request.xml -o c:\response.xml -H "Content-type: text/xml;charset=utf-8" 
     "https://customer.ultimo.net/Webservices/Connector.ashx?username=<<username>>&password=<<password>>&action=export&exportName=<<exportconnectorname>>"

To import data the action should be changed to import:

curl --data-binary @c:\request.xml -o c:\response.xml -H "Content-type: text/xml;charset=utf-8" 
     "https://customer.ultimo.net/Webservices/Connector.ashx?username=<<username>>&password=<<password>>&action=import&importName=<<importconnectorname>>"

Last updated