2017-03-06 6 views
1

Bugzillaで安らかなWebサービスAPIを使用して新しいバグを作成するサンプルコードはありますか?私がこれまで行ってきたことは、それがどのように動作するかを確認するために郵便配達を使用している:BugzillaでBugzillaにバグを作成するRestful Api

シンプルなJSONコード:私は取得しています

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

エラーログ:これはエンドポイントである

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

{ 
    "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

残りのAPIを使用してBugzilla 5.xでバグを作成するためのPythonで作成されたサンプルの例です。

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) 
関連する問題