Merge pull request #1389 from collinjackson/contentType
Example of setting the content type of a POST request
This commit is contained in:
commit
d48a469f8a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user