Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

Send Form Data in HTTP POST request in Flutter

import 'package:http/http.dart' as http;

void main() {
    // This will be sent as form data in the post requst
    var map = new Map<String, dynamic>();
    map['username'] = 'username';
    map['password'] = 'password';

    final response = await http.post(
        Uri.parse('http/url/of/your/api'),
        body: map,
    );

    print(response.body);
}
Source by devsheet.com #
 
PREVIOUS NEXT
Tagged: #Send #Form #Data #HTTP #POST #request #Flutter
ADD COMMENT
Topic
Name
7+5 =