using (var httpClient = new HttpClient())
{
    HttpResponseMessage response;

    HttpContent content = new StringContent(serialisedLoginCredentials, Encoding.UTF8, "application/json");
    try
    {
        response = await httpClient.PostAsync(url, content);
    }
    catch (WebException ex)
    {
        // handle web exception
        throw new Exception("WebException Auth(). PostAsync error posting to " + url, ex);
    }
    catch (TaskCanceledException ex)
    {
        throw new Exception("TaskCanceledException Auth(). PostAsync error posting to " + url, ex);//this happens on a timeout - it should be a WebException but there's a bug in HttpClient
    }
    catch (Exception ex)
    {
        throw new Exception("Exception Auth(). PostAsync error posting to " + url, ex);
    }

    if (response.StatusCode == HttpStatusCode.OK)
    {
        var responseContent = await response.Content.ReadAsStringAsync();
        //Deserialize into appropriate object
    }
    else
    {
        httpResponseMessage.StatusCode = response.StatusCode;
        httpResponseMessage.ReasonPhrase = response.ReasonPhrase;
    }
}