What is the best practice to get data from two different http end points?

Adnan Alshami

I want to fetch a list of Posts and display them in a ListView, each element of this ListView contains a title,body, and the userImage. these data will comes from two different end points from the well known jsonplaceholder https://jsonplaceholder.typicode.com/posts and https://jsonplaceholder.typicode.com/users

I have already made the Post and the User models. should I create another PostWithUser model? or what?

so what is the efficient way to combine these two http requests?

Sorry for my bad English.

Gopikrishnan

You can try with Future.wait. refer the following documentation

https://api.dart.dev/stable/2.5.0/dart-async/Future/wait.html

Eg. Future.wait([apiCall1(), apiCall2()])

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What is the best practice to get related/nested data from REST API?

From Dev

REST end points - Best practice

From Dev

What is the best practice to get user data in silex?

From Dev

Best practice to query data from two (or more) schemas in NoSQL database

From Dev

What is the best practice to get Looper?

From Dev

What will be the best practice to fetch data from MSSQL and insert/update to MySQL?

From Dev

What is the best practice of passing data from a controller to a view layout?

From Dev

What is the best practice in Angular 8 to consume data from service?

From Dev

What is the best practice to return a set of static data from 2 arrays

From Dev

Best practice setup for two websites with different style sheets and templates, but similar Django back end

From Dev

What is the best method to get data from database?

From Dev

Best practice for choosing ids when get data from another system

From Dev

Best practice for calling two different endpoints for a widget?

From Dev

What is the best way to get numbers from the end of string?

From Dev

What is best practice to implement SQS on different environments?

From Dev

AWS DLQ for two consumers, what is best practice?

From Dev

labeling data points from two different dataframe columns

From Dev

what is the best practice for communication between child and parent components from the child end?

From Dev

Get Common data from two different table

From Dev

what is the best way to select different data from same table in Laravel?

From Dev

What is the best practice for powerbi data preparation

From Dev

What is the best practice for loading data into BigQuery table?

From Dev

What is best practice for handling data in React components?

From Dev

What is the optimized/best way to retrieve data from two tables?

From Dev

What's the best practice to fetch specific fields from big data coming from RESTful service in Angular?

From Dev

Web API 2 : Best Practice returning ViewModel data from Controller to $http Success result ?

From Dev

what is the best way to compare two tables from two different database instances

From Dev

What is the best way to get NGRX data from multiple slices of the store

From Dev

What is the best way to get the data from an array that is stored in localstorage?

Related Related

  1. 1

    What is the best practice to get related/nested data from REST API?

  2. 2

    REST end points - Best practice

  3. 3

    What is the best practice to get user data in silex?

  4. 4

    Best practice to query data from two (or more) schemas in NoSQL database

  5. 5

    What is the best practice to get Looper?

  6. 6

    What will be the best practice to fetch data from MSSQL and insert/update to MySQL?

  7. 7

    What is the best practice of passing data from a controller to a view layout?

  8. 8

    What is the best practice in Angular 8 to consume data from service?

  9. 9

    What is the best practice to return a set of static data from 2 arrays

  10. 10

    Best practice setup for two websites with different style sheets and templates, but similar Django back end

  11. 11

    What is the best method to get data from database?

  12. 12

    Best practice for choosing ids when get data from another system

  13. 13

    Best practice for calling two different endpoints for a widget?

  14. 14

    What is the best way to get numbers from the end of string?

  15. 15

    What is best practice to implement SQS on different environments?

  16. 16

    AWS DLQ for two consumers, what is best practice?

  17. 17

    labeling data points from two different dataframe columns

  18. 18

    what is the best practice for communication between child and parent components from the child end?

  19. 19

    Get Common data from two different table

  20. 20

    what is the best way to select different data from same table in Laravel?

  21. 21

    What is the best practice for powerbi data preparation

  22. 22

    What is the best practice for loading data into BigQuery table?

  23. 23

    What is best practice for handling data in React components?

  24. 24

    What is the optimized/best way to retrieve data from two tables?

  25. 25

    What's the best practice to fetch specific fields from big data coming from RESTful service in Angular?

  26. 26

    Web API 2 : Best Practice returning ViewModel data from Controller to $http Success result ?

  27. 27

    what is the best way to compare two tables from two different database instances

  28. 28

    What is the best way to get NGRX data from multiple slices of the store

  29. 29

    What is the best way to get the data from an array that is stored in localstorage?

HotTag

Archive