Skip to content

Using DataSetAdapter.Get #96

Answered by viniciussanchez
rasaliad asked this question in Q&A
Discussion options

You must be logged in to vote

You will have to get the JSON manually. And load into your dataset. JSON automatically loads the first level just... a, r, s, e, m. You can also create a Master Detail DataSet. Then it would work... but the simplest way would be to get the JSON manually and load only what you need.

uses RESTRequest4Delphi, DataSet.Serialize;

var
  LResponse: IResponse;
begin
  LResponse := TRequest.New.BaseURL('').Get;
  if LResponse.StatusCode = 200 then
    DataSet.LoadFromJSON(LResponse.JSONValue.GetValue<TJSONArray>('r'));

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rasaliad
Comment options

@viniciussanchez
Comment options

@mariolandossa
Comment options

Answer selected by viniciussanchez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants