优化put示例json显示

This commit is contained in:
TommyLemon 2017-01-08 12:01:23 +08:00
parent 66f1f4c2cf
commit 6a2eff6358
2 changed files with 6 additions and 5 deletions

View File

@ -16,11 +16,9 @@
<string name="access_error">Access Error</string>
<string name="access_permitted">Access Permitted</string>
<string name="query_error">There may be something wrong,you can follow by the steps:\n\n1.Check your net connection\n\n2.Check the url whether it\'s an available ipv4 address\n\n3.Long click the [get] button to open the request by web browser\n\n4.Check logs outputed on the target server\n\n5.Try again</string>
<string name="demo_post">{\n&#160;&#160;&#160;\"tag\":"post_user",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":"Tommy",\n&#160;&#160;&#160;&#160;&#160;&#160;\"sex\":0,\n&#160;&#160;&#160;&#160;&#160;&#160;\"phone\":"1234567890"\n&#160;&#160;&#160;}\n}</string>
<string name="demo_delete">{\n&#160;&#160;&#160;\"tag\":"delete_user",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":93794\n&#160;&#160;&#160;}\n}</string>
<string name="demo_put">{\n&#160;&#160;&#160;\"tag\":"put_user",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710,\n&#160;&#160;&#160;&#160;&#160;&#160;\"picture\":"[ "http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000",
"http://common.cnblogs.com/images/icon_weibo_24.png",
"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000"]"\n&#160;&#160;&#160;}\n}</string>
<string name="demo_post">{\n&#160;&#160;&#160;\"tag\":\"post_user\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":\"Tommy\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"sex\":0,\n&#160;&#160;&#160;&#160;&#160;&#160;\"phone\":\"1234567890\"\n&#160;&#160;&#160;}\n}</string>
<string name="demo_delete">{\n&#160;&#160;&#160;\"tag\":\"delete_user\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":93794\n&#160;&#160;&#160;}\n}</string>
<string name="demo_put">{\n&#160;&#160;&#160;\"tag\":\"put_user\",\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710,\n&#160;&#160;&#160;&#160;&#160;&#160;\"name\":\"Lemon\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"picture\":\"[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\", \"http://common.cnblogs.com/images/icon_weibo_24.png\", \"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\"]\"\n&#160;&#160;&#160;}\n}</string>
<string name="demo_single">{\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710\n&#160;&#160;&#160;}\n}</string>
<string name="demo_columns">{\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"columns\":\"id,name,phone\",\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":38710\n&#160;&#160;&#160;}\n}</string>
<string name="demo_rely">{\n&#160;&#160;&#160;\"User\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"id\":70793\n&#160;&#160;&#160;},\n&#160;&#160;&#160;\"Work\":{\n&#160;&#160;&#160;&#160;&#160;&#160;\"userId\":\"User/id\"\n&#160;&#160;&#160;}\n}</string>

View File

@ -46,11 +46,14 @@ public class RequestUtil {
public static JSONObject newPutRequest() {
User data = new User(38710);
data.setName("Lemon");
List<String> list = new ArrayList<String>();
list.add("http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000");
list.add("http://common.cnblogs.com/images/icon_weibo_24.png");
list.add("http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000");
data.setPicture(JSON.toJSONString(list));
return new JSONRequest(data).setTag("put_user");
}