1
+ import json
1
2
import requests
2
3
3
4
@@ -8,17 +9,18 @@ def __init__(self, url, username, password):
8
9
self .username = username
9
10
self .password = password
10
11
11
- def get (self , path ):
12
+ def get (self , path , headers = { "Content-Type" : "application/json" , "Accept" : "application/json" } ):
12
13
url = "{0}{1}" .format (self .url , path )
13
- return requests .get (url , auth = (self .username , self .password ))
14
+ return requests .get (url , headers = headers , auth = (self .username , self .password ))
14
15
15
- def post (self , path , data = None ):
16
+ def post (self , path , data = None , headers = { "Content-Type" : "application/json" , "Accept" : "application/json" } ):
16
17
url = "{0}{1}" .format (self .url , path )
17
- return requests .post (url , data , auth = (self .username , self .password ))
18
+ return requests .post (url , json . dumps ( data ), headers = headers , auth = (self .username , self .password ))
18
19
19
- def delete (self , path ):
20
+ def delete (self , path , headers = { "Content-Type" : "application/json" , "Accept" : "application/json" } ):
20
21
url = "{0}{1}" .format (self .url , path )
21
- return requests .delete (url , auth = (self .username , self .password ))
22
+ return requests .delete (url , headers = headers , auth = (self .username , self .password ))
22
23
23
24
25
+ from .confluence import Confluence
24
26
from .jira import Jira
0 commit comments