web stats
HTTP Listener POST Content-Type application/x-www-form-urlencoded Blank Input - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2016, 02:34 PM
lspiehler lspiehler is offline
What's HL7?
 
Join Date: Dec 2016
Posts: 2
lspiehler is on a distinguished road
Default HTTP Listener POST Content-Type application/x-www-form-urlencoded Blank Input

I would like to use Twilio (SMS Service) to POST incoming messages to Mirth through an HTTP Listener. Their messages come through as Content-Type application/x-www-form-urlencoded and the POST data looks like variable1=value1&variable2=value2&variable3=value3 .

No matter what I do, if the Content-Type in the header is sent to Mirth as application/x-www-form-urlencoded, I never receive any data from the source in Mirth. It is just blank! Currently I'm receiving the data on another web server, converting the data to JSON, modifying the header and re-POSTing the data to Mirth to get it to work, but I'd like to cut out the middle man. Any ideas? Thank you.
Reply With Quote
  #2  
Old 12-27-2016, 05:01 PM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

When an HTTP Listener receives that content type, it will automatically parse it into a map which will be available in the source map as "parameters". Look at the Mappings tab for your message.

To get a parameter in your channel code, do this:

Code:
$('parameters').getParameter('varName')
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 12-28-2016, 12:38 PM
lspiehler lspiehler is offline
What's HL7?
 
Join Date: Dec 2016
Posts: 2
lspiehler is on a distinguished road
Default

Thank you for the advice. With your help I got it working!
Reply With Quote
Reply

Tags
blank message, http listener, x-www-form-urlencoded

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation