0
votes

curl --location --request GET 'My_API?'
--header 'Content-Type: application/json'
--data-raw '[ { "id": "", "placeid": "EiBMZXdpc2hhbSBXYXksIExvbmRvbiBTRTQgMVVZLCBVSyIuKiwKFAoSCXk1YsdYAnZIERCJXqRiE8WPEhQKEgnrjwApXwJ2SBH76fXJO6C02w", "address": "Lewisham Way, London SE4 1UY, UK", "postcode": "SE4 1UY", "outcode": "SE4 1UY", "lattitude": 51.4702816, "country": "United Kingdom", "city": "Greater London", "longitude": -0.029187800000045172 }, { "_id": "null", "placeid": "", "address": "Kenley Road, London SW19 3DW, UK", "postcode": "SE23 3RF", "outcode": "SE23", "lattitude": "51.404556", "country": "", "city": "", "longitude": "-0.194486" } I want to fetch distance between these points. it is working fine in Postman but not working in Flutter. Flutter Code

var req = await Requests.post('my_api?', headers: { 'Content-Type' : 'application/json' }, body: queryParameters); print('response_____________O______________)__________0___________O\n'); print(req.json()); print(req.content().length);

1
elaborate your issue - Janvi Patel
i want to fetch data from api passing list of object two as parameter in http request . when I'm passing these objects post man as body it is working fine but not working in flutter. - Abdul Rahman Panhyar
post your question in proper format cant understand anything - Janvi Patel
Can you share photo of postman? - Priyesh

1 Answers

0
votes

Have you check https://flutter.dev/docs/development/data-and-backend/json? You could put all these data in a class defined for.