接口名称:
- response.html
描述:返回一个html格式数据
URL:http://afnetworking.sinaapp.com/response.html
结果:<h1>AFNetworking test!</h1>
- response.xml
描述:返回一个xml格式数据
URL:http://afnetworking.sinaapp.com/response.xml
结果:<?xml version="1.0" encoding="UTF-8"?><doc><person id="1" sex="m"><name>zhangsan</name><age>32</age><adds><add code="home">home add</add><add code="com">com add</add></adds></person><person id="2" sex="w"><name>lisi</name><age>22</age><adds><add ID="22" id="23" code="home">home add</add><add ID="23" id="22" code="com">com add</add><add id="24" code="com">com add</add></adds></person></doc>
- response.json
描述:返回一个json的数据
URL:http://afnetworking.sinaapp.com/response.json
结果:{"data": "This is a json data.", "success": true}
- request_get.json
描述:使用GET方式请求
URL:http://afnetworking.sinaapp.com/request_get.json
参数:"foo=bar"
结果:
Success:{"data": {"foo": "bar"}, "success": true}
Error:{"errors": "Parameter error!", "success": false}
- request_post_body_http.json
描述:使用POST方式请求,参数用HTTP序列化
URL:http://afnetworking.sinaapp.com/requset_post.json
参数:"foo=bar"
结果:
Success:{"data": {"foo": "bar"}, "success": true}
Error:{"errors": "Parameter error!", "success": false}
- request_post_body_json.json
描述:使用POST方式请求,参数用JSON序列化
URL:http://afnetworking.sinaapp.com/requset_post.json
参数:"foo:bar"
结果:
Success:{"data": {"foo": "bar"}, "success": true}
Error:{"errors": "Parameter error!", "success": false}
- upload2server.json
描述:上传文件到服务器
URL:http://afnetworking.sinaapp.com/requset_post.json
参数:file:image fileName:customName
结果:
Success:{"data": ["name":customName, "url":URLByServer], "success": true}
Error:{"errors": "The file save failed!", "success": false}
- persons.json
描述:请求人员信息列表
URL:http://afnetworking.sinaapp.com/persons.json
METHOD:POST
参数:"person_type=student|teacher"
结果:
Success:{"data":[{"stu_id":"1234", "name":"zhangsan", "age":"34"},{"stu_id":"5678", "name":"lisi", "age":"28"}], "success": true}
Error:{"errors": "Please use the POST method!", "success": false}
{"errors": "Parameter error!", "success": false}