This is what you need in your code
webClient2.Headers["Content-Type"] = "application/x-www-form-urlencoded";
and then
string datax = JsonConvert.SerializeObject(r);
datax = "0=" + datax;
in the server I would replace echo $x;
with print_r($x);