Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot get data from response when using HttpClient.GetJsonAsync #1796

qwertylb opened this Issue Mar 14, 2019 · 1 comment


None yet
1 participant
Copy link

qwertylb commented Mar 14, 2019

When using HttpClient.GetJsonAsync, docList can't get Json data with Object List<Doc>. I set breakpoint in LogsController.cs, it's obvious that ActionResult already has Value. But docList is null. The following code snippet is a part of the webapplication.
How to get data and use it?
Thank you for your support...

<TextEdit Placeholder="PlayerGuid" bind-text="@account" />

<SimpleButton Clicked="@(async () => await GetLogs(account))" Class="form-control" Color="Color.Primary">

    @if (docList == null)
    { <p>there are no doc to display</p>}
    @foreach (var doc in docList)



    List<Doc> docList = new List<Doc>();
    string account;
    string document;

    public async Task GetLogs(string acc)
        docList = await Http.GetJsonAsync<List<Doc>>("api/value/" + acc);


private readonly ElasticClient _client;
public async Task<ActionResult<List<Doc>>> Search(string param)
    return  _client.Search<Doc>(s => s
        .Query(q => q.Match(m => m.Field(f => f.account).Query(param)))).Documents.ToList<Doc>();     

@qwertylb qwertylb changed the title cannot get any data from response when using HttpClient.GetJsonAsync cannot get data from response when using HttpClient.GetJsonAsync Mar 15, 2019

@qwertylb qwertylb closed this Mar 15, 2019


This comment has been minimized.

Copy link

qwertylb commented Mar 15, 2019

it was post on AspNetCore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.