title: Send data between php and dart
body: <p>So i am trying to communicate between dart clientside and a php server side using AJAX. Since direct execution is not possible. I compiled the dart to javascript and then run it on a apache server. </p>
  
  <p>json data is generated at client end, But there is no response from the the server</p>
  
  <p>dart code</p>
  
  <pre><code>import 'dart:html';
  import 'dart:json';
  
  void main() {
    query("#clicker").on.click.add(callServer);
  
  }
  
  void callServer(Event event) {
    var data ={ 'name':"sendname"}
    ,jsondata=stringify(data);
    print(jsondata);
  
    var req = new HttpRequest();
    req.open('post','http://localhost:8080/darttest/server.php',true);
    //req.setRequestHeader('Content-type','application/json');
    req.send(jsondata);
    print(req.responseText);
  }
  </code></pre>
  
  <p>php side i just echo the content received</p>
  
  <pre><code>&lt;?php
  
  $name = $_POST['name'];
  echo $name;
  
  ?&gt;
  </code></pre>
  
  <p>This is my first try at dart programming, so do let me know if this approach is even possible</p>