How to send Mirth HTTP connector using POST

ChronoFish picture ChronoFish · Apr 12, 2013 · Viewed 9.7k times · Source

We have a mirth instance sending out using a POST method to a rest service.

However, Mirth seems to be sending at least one parameter through the URL (like a GET) instead.

We have the following options set:

Method: POST Multipart: No Send Response to: none Response Content: Headers and Body as XML Authentication: No Use Persistent Queues: No Charset Encoding: UTF-8

Then we have 5 query parameters -

One of which is the name "file" and value of "${message.rawData}". I am watching the Apache request log and can see this attribute/value pair come across the URL (as if it were doing a GET instead of a POST).

No headers

Content Type text/plain Content: literal "no data."

We are using Mirth Connect Server 2.2.1.5861

How do I force this value ('file') to come across the POST?

Answer

ChronoFish picture ChronoFish · Apr 23, 2013

While @Dave's response made sense, it didn't actually work for me. But it did send me down the path of further investigation.

The biggest key was that in order send the list attribute/values pairs as a "post" in the "web form processing" sense, you need to do this:

Set the payload "type" to:

application/x-www-form-urlencoded

This forces all elements to be "post'ed". If you want a mix bag (which for reasons known only to purest is "bad form") then you need to jump through more hoops.

See the following link for details:

Mirth Forums Thread related to accessing a RESTful web service