My fellow programmers, I basically have this async Get() method which is reading Json data successfully, but when locating to route -> localhost:59185/api/encompass/data I receive a message:
No HTTP resource was found that matches the request URL 'http://localhost:59185/api/encompass/data'.
</Message>
I was very hopeful that it would return my JSON especially when in debug the code its sitting in 'string res' at the bottom
anyone know why its not returning Json even thought its sitting in 'res'?
Controller:
[HttpGet, Route("encompass/data")]
public async Task<string> Get(string Accesstoken)
{
string res = "";
using (var client = new HttpClient())
{
Accesstoken = Accesstoken.Substring(17, 28);
client.BaseAddress = new Uri("https://api.elliemae.com/");
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + Accesstoken);
var response = client.GetAsync("encompass/v1/loans/ea7c29a6-ee08-4816-99d2-fbcc7d15731d").Result;
using (HttpContent content = response.Content)
{
// ... Read the string.
Task<string> result = content.ReadAsStringAsync();
res = result.Result;
}
return res; //<- this is not returning the JSon thats sitting in here
}
}