2017-03-06 64 views
1

使用restful webservice API在Bugzilla中创建新错误的任何示例代码?什么到目前为止,我已经做了邮差使用,看看它是如何工作的:使用Bugzilla Restful Api在Bugzilla中创建错误

简单的JSON代码:

{ 
    "product" : "TestProduct", 
    "component" : "TestComponent", 
    "summary" : "This is the best bug report", 
    "version" : "unspecified", 
    "description" : "This is the best GUI for reporting bugs" 
} 

这是端点:

http://localhost/bugzilla/rest.cgi/rest/bug 

错误日志我越来越:

{ 
    "code": 32614, 
    "message": "A REST API resource was not found for 'POST /rest/bug'.", 
    "documentation": "https://bugzilla.readthedocs.org/en/5.0/api/", 
    "error": true 
} 

回答

1

以python编写的示例示例,使用其余的API在Bugzilla 5.x中创建一个bug。

import requests 

data = { 
    "product" : "TestProduct", 
    "component" : "TestComponent", 
    "summary" : "This is the best bug report", 
    "version" : "unspecified", 
    "description" : "This is the best GUI for reporting bugs" 
} 
url_bz_restapi = 'http://localhost/bugzilla/rest.cgi/bug' 
r = requests.post(url_bz_restapi, data=data)