title: http request in javascript pdf api
body: <p>I'm trying to do a get request with the javascript api to adobe reader. I'm using the Net.http object with the following code:</p>
  
  <pre><code>get =  app.trustedFunction (function(cURL)
  {
      app.beginPriv();
      var params =
       {
          cVerb: "GET",
          cURL: "HTTP://ip_addr/checker/comments/1",
          oHandler:
          {
              response: function(msg, uri, e)
                  {
                      if(e != undefined &amp;&amp; e.error != 405) {
                          app.alert("Failed to get: "+ e);
                      } else app.alert("connected");
                  }
                }
          };
          Net.HTTP.request(params);
      app.endPriv();
   });
  </code></pre>
  
  <p>When I call the function in my code, the first time the program opens its working fine and can connect.</p>
  
  <p>The problem is that when I call the function again using a submenu like this:</p>
  
  <pre><code>  app.addMenuItem ({cName: "connect", cParent: "Edit", cExec: "get()"});
  </code></pre>
  
  <p>I get an error, I also tried adding this PDF file to my privileged locations because I think it's a security related issue</p>
  
  <p>Any idea?</p>