Question

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?

Was it helpful?

Solution

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

OTHER TIPS

Query parameters in mirth are URL parameters. Therefore it's going to come across similar to a Get. If you want to Post variables you need to encode them in the 'Content' section of the http sender.

I believe it follows a similar encoding, though you may want to look into it further

lastName=Smith&age=31&team=woodchucks

So you would probably want something like:

file=${message.rawData}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top