title: how to send data to php webservice using GET method in JSON Format in C#
body: <p>I am new to webservice, and I am trying to send JSON data to .php webservice from my WP7 application created in VS2010. I have used the UploadStringAsync method, but this method is not working with the GET method. It is throwing exception while using the GET Method. Please help.</p>
  
  <p><strong>below is my c# code</strong></p>
  
  <pre><code>WebClient postWithParamsClient = new WebClient();
  
  postWithParamsClient.Headers["Content-type"] = "application/json";
  postWithParamsClient.UploadStringCompleted += new UploadStringCompletedEventHandler(postWithParamsClient_UploadStringCompleted);
  
  postWithParamsClient.UploadStringAsync(url, "POST", "{ \"latitude\": " + textBox2.Text.ToString() + ", \"longitude\": " + textBox3.Text.ToString() + " }");
  </code></pre>
  
  <p><strong>below is my webservice</strong></p>
  
  <pre><code>&lt;?php
  /*XML FORMAT
  &lt;gpstrack&gt;
      &lt;latitude&gt;30°N&lt;/latitude&gt;
      &lt;longitude&gt;38°N&lt;/longitude&gt;
      &lt;mobtime&gt;mobiletime&lt;/mobtime&gt;
  &lt;/gpstrack&gt;
  XML FORMAT*/
  
  $xml = file_get_contents('php://input');
  $finalArray = json_decode(json_encode((array) simplexml_load_string($xml)),1);
  //$finalArray=array('latitude'=&gt;'12.1','longitude'=&gt;'3.2','mobtime'=&gt;'325695142');
  
  $newfb = new TABLE($db,"gpslog","track_id");
  $newfb -&gt; latitude              = $finalArray['latitude'];
  $newfb -&gt; longitude             = $finalArray['longitude'];
  $newfb -&gt; mobtime               = strtotime($finalArray['mobtime']);
  
  $newfb -&gt; insert(); 
  print "success";
  
  exit;
  ?&gt;
  </code></pre>