Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter send json body to api

Future<http.Response> createFunction(String str) {
  return http.post(
    Uri.parse('https://your_domain.com/path'),
    headers: <String, String>{
      'Content-Type': 'application/json; charset=UTF-8',
    },
    body: jsonEncode(<String, String>{
      'str': str,
    }),
  );
}
Comment

send json body http get flutter

final queryParameters = {
  'name': 'Bob',
  'age': '87',
};
final uri = Uri.http('www.example.com', '/path', queryParameters);
final headers = {HttpHeaders.contentTypeHeader: 'application/json'};
final response = await http.get(uri, headers: headers);
Comment

PREVIOUS NEXT
Code Example
Dart :: dash border style flutter 
Dart :: how to give bottom padding in Listview in flutter 
Dart :: extend class flutter 
Dart :: flutter snackbar duration 
Dart :: splite number in dart 
Dart :: flutter horizontal line 
Dart :: unable to locate android sdk flutter in windows 
Dart :: flutter flat button size 
Dart :: convert future<list list in flutter 
Dart :: flutter get package command 
Dart :: dart store unique values 
Dart :: flutter inner box shadow plugin 
Dart :: set orientation to landscape flutter 
Dart :: datetimeoffset flutter 
Dart :: flutter random int 
Dart :: settimeout dart 
Dart :: get initials from name flutter on text 
Dart :: set minus padding in flutter 
Dart :: convert string date to datetime and format 
Dart :: message yes or not in dart 
Dart :: Named parameters dart 
Dart :: select date from datepicker in textfield flutter 
Dart :: flutter showdialog barrierdismissible 
Dart :: dart any 
Dart :: what does translate do in transform widget fluter 
Dart :: flutter crop captured image 
Dart :: parse int to string in flutter 
Dart :: speedometer in flutter 
Dart :: support various locales flutter 
Dart :: Flutter Text new fline 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =