title: invoking R plumber code via jquery
body: <p>I've created my R file and plumber code. I am able to access it if I paste the url in the browser.</p>
  
  <pre><code>http://localhost:8000/calculate_score?date=07%2F03%2F2017
  </code></pre>
  
  <p>but when I try to access it with via jquery ajax like this:</p>
  
  <pre><code>$.ajax({
               url: "http://localhost:8000/calculate_score?date="+JSON.stringify(encodeURIComponent($( "#datepicker" ).val())),
               type:"POST",
               dataType: "jsonp"
            }).then(function(data) {
  
                  alert("sucess:"+data);
  
  
            var obj = JSON.parse(output);
  
  }
  </code></pre>
  
  <p>I get a connection refused error. </p>
  
  <pre><code>GET http://&lt;my ip&gt;:8000/calculate_score?date=%2207%2F04%2F2017%22&amp;callback=jQuery1102037260698059372777_1502383033542&amp;_=1502383033543 net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>How to resolve the issue? I am using chrome. I tried with jsonp and type "GET" as well.</p>
  
  <p>EDIT: Including my plumber.R code</p>
  
  <pre><code>r &lt;- plumb("&lt;my_path&gt;/api_functions.R") 
  r$run(port=8000)
  </code></pre>