I am trying to send a string from my C# app to my php server (first time using async). When I try to write out my response to the console, I just get this: System.Threading.Tasks.Task'1[System.String]
C# Code
private HttpClient request;
public async Task<string> licenseCheck(HttpClient client, string email){
var payload = new Dictionary<string, string>
{
{ "email", email }
};
var content = new FormUrlEncodedContent(payload);
var response = await client.PostAsync("https://example.io/checkin.php", content);
return await response.Content.ReadAsStringAsync();
}
request = new HttpClient();
Console.WriteLine(licenseCheck(request,"joe@example.com").ToString());
PHP Code - checkin.php
<?php
$email = trim(strtolower($_POST['email']));
header('Content-Type: application/x-www-form-urlencoded');
echo $email;