From cd95d51c70056a5c50764fc1a35e7989d710db48 Mon Sep 17 00:00:00 2001 From: Collin Jackson Date: Tue, 26 Jan 2016 12:24:01 -0800 Subject: [PATCH] Example of setting the content type of a POST request --- examples/widgets/http_post.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/widgets/http_post.dart b/examples/widgets/http_post.dart index 2752b2e04b..ebbd0b1330 100644 --- a/examples/widgets/http_post.dart +++ b/examples/widgets/http_post.dart @@ -38,8 +38,8 @@ class PostDemoState extends State { }); http.Response response = await http.post( "http://httpbin.org/post", - body: "asdf=42", - headers: { "foo": "bar" } + body: '{"foo": "bar"}', + headers: { "Content-Type": "application/json", "baz": "qux" } ); setState(() { _response = response.body;