查看jenkins的python api与json api,感觉两者相差不多,但还是有所区别,所以用BeyondCompare进行对比分析。
1、jenkins base url的api对比
左侧的为:http://server:port/jenkins/api/python?pretty=true
右侧的为:http://server:port/jenkins/api/json?pretty=true
[attach]122864[/attach]
2、jenkins job的api对比
左侧的为:http://server:port/jenkins/job/JOB_NAME/api/python?pretty=true
右侧的为:http://server:port/jenkins/job/JOB_NAME/api/json?pretty=true
[attach]122865[/attach]
3、jenkins build的api对比
左侧的为:http://server:port/jenkins/job/JOB_NAME/BUILD_NUMBER/api/python?pretty=true
右侧的为:http://server:port/jenkins/job/JOB_NAME/BUILD_NUMBER/api/json?pretty=true
[attach]122866[/attach]
4、jenkins view的api对比
左侧的为:http://server:port/jenkins/view/VIEW_NAME/api/python?pretty=true
右侧的为:http://server:port/jenkins/view/VIEW_NAME/api/json?pretty=true
[attach]122867[/attach]
5、jenkins nodes的api对比
左侧的为:http://server:port/jenkins/computer/api/python?pretty=true
右侧的为:http://server:port/jenkins/computer/api/json?pretty=true
[attach]122868[/attach]
从上述api不同处,可以看出python和json(JavaScript )语法有两处不同:
* Python的boolean类型的值为:True/False;json的boolean类型的值为:true/false
* Python的空值为:None;json的空值为:null
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) | Powered by Discuz! X3.2 |