I'm relatively new to flutter. I'm trying to make an API call using the flutter HTTP package (along with header and body)
For example, how could I make the same call in Flutter HTTP?
curl --location --request POST 'xyz.com' \
--header 'Referer: {{your app package name or website url}}' \
--header 'API-KEY: {{api-key}}' \
--data-urlencode 'vehicleId=MHxxxxxxxx' // how to pass this in http body
This is what I could do so far, am I doing it correctly so far? How can I pass body content?
Map<String, String> headers = {"Referer": "abcd.com", "API-KEY": "abcd12345"};
var url = Uri.parse('xyz.com');
var response = await post(url, headers: headers);