Commit cd95d51c authored by Collin Jackson's avatar Collin Jackson

Example of setting the content type of a POST request

parent 7737117a
......@@ -38,8 +38,8 @@ class PostDemoState extends State<PostDemo> {
});
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment