Chromium Code Reviews| Index: recipes/dart_io/pkg_http/bin/making_a_post_request.dart |
| diff --git a/recipes/dart_io/pkg_http/bin/making_a_post_request.dart b/recipes/dart_io/pkg_http/bin/making_a_post_request.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5dd3136a8365059b0597fee1412350172fe6722e |
| --- /dev/null |
| +++ b/recipes/dart_io/pkg_http/bin/making_a_post_request.dart |
| @@ -0,0 +1,9 @@ |
| +import 'package:http/http.dart' as http; |
| + |
| +void main() { |
| + var url = 'http://httpbin.org/post'; |
| + http.post(url, fields: {"name": "doodle", "color": "blue"}).then((response) { |
|
Anders Johnsen
2013/12/06 11:53:28
This is posting specific fields. To match the test
shailentuli
2013/12/06 18:16:29
Anders, there is no data arg for http.post(). I'm
|
| + print("Response status: ${response.statusCode}"); |
| + print("Response body: ${response.body}"); |
| + }); |
| +} |