<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Apache livy and Ajax in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177878#M140125</link>
    <description>&lt;P&gt;Thank you very much for your answer. I will see that deeply. It seems that it can help me.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jul 2018 00:33:08 GMT</pubDate>
    <dc:creator>ndumelchipaul20</dc:creator>
    <dc:date>2018-07-04T00:33:08Z</dc:date>
    <item>
      <title>Apache livy and Ajax</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177876#M140123</link>
      <description>&lt;P&gt;Good morning every one,&lt;/P&gt;&lt;P&gt;can someone help me with how to send a post request by ajax to the apache livy server? I tried my best but I don't see how to do that. I have a textarea in which user can put his spark code. I want to send that code to the apache livy by ajax and get the result. I don't if my question is clear. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 22:34:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177876#M140123</guid>
      <dc:creator>ndumelchipaul20</dc:creator>
      <dc:date>2018-07-03T22:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Apache livy and Ajax</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177877#M140124</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/87152/ndumelchipaul2000.html" nodeid="87152"&gt;@Melchicédec NDUWAYO&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You could use the following java script client package or similar:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.npmjs.com/package/livy-client" target="_blank"&gt;https://www.npmjs.com/package/livy-client&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or you could code your own using javascript jquery or similar. &lt;/P&gt;&lt;P&gt;Overall steps you should consider:&lt;/P&gt;&lt;P&gt;1. Create a livy session to be able to submit code&lt;/P&gt;&lt;P&gt;2. Reference the session id when running the code&lt;/P&gt;&lt;P&gt;Also keep the livy api link handy when working with livy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://livy.incubator.apache.org/docs/latest/rest-api.html" target="_blank"&gt;https://livy.incubator.apache.org/docs/latest/rest-api.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 23:47:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177877#M140124</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-07-03T23:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Apache livy and Ajax</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177878#M140125</link>
      <description>&lt;P&gt;Thank you very much for your answer. I will see that deeply. It seems that it can help me.&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 00:33:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177878#M140125</guid>
      <dc:creator>ndumelchipaul20</dc:creator>
      <dc:date>2018-07-04T00:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Apache livy and Ajax</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177879#M140126</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/87152/ndumelchipaul2000.html" nodeid="87152"&gt;@Melchicédec NDUWAYO&lt;/A&gt; If the above answer has helped please login and mark the answer as "Accepted" &lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 00:40:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177879#M140126</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-07-04T00:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Apache livy and Ajax</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177880#M140127</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11048/falbani.html" nodeid="11048"&gt;@Felix Albani&lt;/A&gt; I don't see exactly how to create that livy session with javascript or jquery. Can you help me please? Is there any documentation about that? Using the livy client package will not be easy for me also because I must use nodejs to get the package and me I created my webapp using java ee with maven. I am weak in javascript programming. Please, help me.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;This is how, normally I send posts to the server using ajax:&lt;/P&gt;&lt;PRE&gt;$.ajax({
                type: 'POST',
                url: 'TraitementsServletPartialAgre',
                data: {drag: drag},
                success: function (resultat) {
                    var myTrees = resultat.split("|");
                    for (var myTree in myTrees) {
                        var myTree = JSON.parse(myTrees[myTree]);
                        new Treant(myTree);
                    }
                }
            });

And this is what I tried with apache livy:

$.ajax({
            type: 'POST',
            dataType:'json',
            url: 'http://localhost:8998/',
            data: {kind: 'spark',
                   code: CodeMirrorString},
            success: function (resultat) {
                document.getElementById(response).innerHTML = resultat;
            }
        });
&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jul 2018 21:29:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-livy-and-Ajax/m-p/177880#M140127</guid>
      <dc:creator>ndumelchipaul20</dc:creator>
      <dc:date>2018-07-04T21:29:49Z</dc:date>
    </item>
  </channel>
</rss>

