web stats
send JSON to HTTP LISTENER - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-10-2016, 11:46 PM
sokra sokra is offline
What's HL7?
 
Join Date: May 2016
Posts: 2
sokra is on a distinguished road
Default send JSON to HTTP LISTENER

HI Guys,

i have a problem with HTTP Listener. I have a javascript function in a php-script like:
Quote:
function send() {
xhr = new XMLHttpRequest();
var url = "http://myurl:5050";
xhr.open("POST", url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
//doSomething();
}
}
var data = {'email':'hey@mail.com','password':'101010'};
xhr.send(JSON.stringify(data));
}
After sending the request, i got an error from my HTTP Listener:
Quote:
SyntaxError: Empty JSON string
What does it mean? Is there an error in my javascript function or in configuration from HTTP Listener?

Have someone an idea?

Kind regards,
Andy
Reply With Quote
  #2  
Old 10-11-2016, 08:24 AM
tiskinty tiskinty is offline
OBX.1 Kenobi
 
Join Date: Jun 2016
Posts: 43
tiskinty is on a distinguished road
Default

can you post your channel?
__________________
Matt

http://theunofficialmirthadmin.blogspot.com/
Reply With Quote
  #3  
Old 10-11-2016, 11:07 PM
sokra sokra is offline
What's HL7?
 
Join Date: May 2016
Posts: 2
sokra is on a distinguished road
Default

here are my channel and the data types I set
Attached Images
File Type: jpg HTTPListener.JPG (94.2 KB, 85 views)
File Type: jpg DataTypes.JPG (26.9 KB, 65 views)
Reply With Quote
Reply

Tags
http listener, json

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 08:34 PM.


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