2017-03-06 85 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)