From an ASP.NET MVC app, I make a POST request to an action on my Web API. The action in the API executes successfully. When I make the same request in a REST client such as Postman for Chrome, I see a valid Json response.
However, if I make the call from my MVC app, I don't see any response back and the flow of control disappears after making the POST request to the API. The MVC app keeps waiting, as though.
Here's my code.
Web API
[HttpPost]
[ActionName("CreateNewUserFromAccountInfo")]
public IUser CreateNew(NewUserAccountInfo newUserAccountInfo)
{
    return _provider.CreateNew(newUserAccountInfo.FullName, newUserAccountInfo.Email, newUserAccountInfo.PasswordHash);
}
MVC app controller
IUser user = new WebAPIClient()
             .PostAsJsonAsync<NewUserAccountInfo, IUser>
              ("api/membership/CreateNewUserFromAccountInfo", 
              newUserAccountInfo
              ).Result;
From the WebAPIClient class from within a class library referenced from the MVC app:
public async Task<R> PostAsJsonAsync<T, R>(string uri, T value)
{
    using (var client = new HttpClient())
    {
        client.BaseAddress = new Uri(_baseUri);
        client.DefaultRequestHeaders.Accept.Clear();
        client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        await PrintRequestBodyToDebugWindowAsync(value, new JsonMediaTypeFormatter());
        // The flow of control just disappears after this line
        // and never gets to the next line
        var response = await client.PostAsJsonAsync(uri, value);
        // The flow of control never gets here
        if (response.IsSuccessStatusCode) return await response.Content.ReadAsAsync<R>();
        else return default(R);
    }
}
RESULTS RETURNED WHEN REQUEST MADE VIA POSTMAN (a REST client)
Request Uri: http://localhost:54488/api/membership/CreateNewUserFromAccountInfo
Method: POST
Request Body: {"FullName":"Aamir Khan","Email":"aamir@khan.com","PasswordHash":"hello"}
Response:
{
    "Id": 15,
    "IsExternal": false,
    "ExternalId": null,
    "ExternalProviderName": null,
    "UserType": "Healthcare Seeker",
    "Verified": false,
    "VerificationCode": "375b8d2f-67df-433d-9e95-c84c30462b80",
    "VerificationCodeExpiresOn": "9999-12-31T23:59:59.9999999",
    "PasswordResetCode": null,
    "DefaultPasswordChanged": false,
    "HasFilledBasicProfile": false,
    "CreationDateTime": "2014-07-01T20:47:45.1405416+05:30",
    "FullName": {
        "Id": 2,
        "Name": "FullName",
        "Value": "Aamir Khan",
        "Description": null,
        "PrivacyLevel": {
            "Id": 1,
            "Name": "Private",
            "Description": "Visible only to me"
        }
    },
    "Email": {
        "Id": 1,
        "Name": "Email",
        "Value": "aamir@khan.com",
        "Description": null,
        "PrivacyLevel": {
            "Id": 1,
            "Name": "Private",
            "Description": "Visible only to me"
        }
    },
    "Profiles": [
        null,
        null,
        null
    ],
    "BasicProfile": null,
    "MedicalProfile": null,
    "EmergencyProfile": null
}
