Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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,
    }),
  );
}
 
PREVIOUS NEXT
Tagged: #flutter #send #json #body #api
ADD COMMENT
Topic
Name
2+3 =