cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming HTTP Adapter output via Javascript/ JQuery

Former Member
0 Kudos

Hello,

I see example in HTTP Adapter that allows me to connect (via HTML and Form POST) to HTTP output adapter, and I can see streams coming out of the browser:

      <form name="input" action="http://<esp_server>:<esp_port>/start" method="post">

         SQL query:   

         <input type="text" name="sql" size="60" value="select * from Stream1">

         <input type="submit" value="Submit">

      </form>

Do you have working example on how to do this as jQuery / ajax?

I'm having issues consuming it, plain vanilla $.post would have CORS issue (ESP server is different from my client), I tried xhr but to not much success either.

A working example would really help as I need to consume this in real-time via browser, and update a field on <div></div> section.

Thank you,

Chin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

To clarify , when I try to convert to using $.post, I'm getting:

XMLHttpRequest cannot load http://<esp_server>:<esp_http_port>/start. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.


Usually if I have control over coding of HTTP server, I can fix this via header, but in this case, its inside the JAR.