From 4f516085acea08827650842c0cdad5deca0dd4df Mon Sep 17 00:00:00 2001 From: EasonPai Date: Thu, 3 Apr 2014 22:00:06 +0800 Subject: [PATCH] Set argument as optional to match method signature The 3rd argument causes error, might be the signature has changed. Also updated deprecated JSON method to new one. --- json_client/web/json_client.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/json_client/web/json_client.dart b/json_client/web/json_client.dart index 50b1a41..9d0d47c 100644 --- a/json_client/web/json_client.dart +++ b/json_client/web/json_client.dart @@ -3,6 +3,7 @@ import 'package:json_object/json_object.dart'; import 'dart:json' as JSON; import 'dart:core' as core; +import 'dart:convert'; var host = "127.0.0.1:8080"; @@ -85,8 +86,8 @@ void saveData(_) { // POST the data to the server var url = "http://$host/programming-languages"; - request.open("POST", url, false); - request.send(JSON.stringify(jsonObject)); + request.open("POST", url, async:false); + request.send(JSON.encode(jsonObject)); } @@ -114,4 +115,4 @@ class LanguageImpl extends JsonObject implements Language { return new JsonObject.fromJsonString(string, new LanguageImpl()); } -} \ No newline at end of file +}