@@ -10,12 +10,11 @@ import (
10
10
)
11
11
12
12
func (api * httpApi ) jiraRequest (method string , restPath string , queryParams interface {}, reqBody io.Reader ) ([]byte , error ) {
13
- queryParamsValues , err := query . Values ( queryParams )
13
+ u , err := api . jiraRequestUrl ( restPath , queryParams )
14
14
if err != nil {
15
15
return nil , err
16
16
}
17
- u := api .restUrl .ResolveReference (& url.URL {Path : path .Join (api .restUrl .Path , restPath ), RawQuery : queryParamsValues .Encode ()})
18
- req , err := http .NewRequest (method , u .String (), reqBody )
17
+ req , err := http .NewRequest (method , u , reqBody )
19
18
req .Header .Add ("Accept" , "application/json" )
20
19
req .Header .Add ("Content-Type" , "application/json" )
21
20
if err != nil {
@@ -32,3 +31,12 @@ func (api *httpApi) jiraRequest(method string, restPath string, queryParams inte
32
31
body , _ := io .ReadAll (response .Body )
33
32
return body , nil
34
33
}
34
+
35
+ func (api * httpApi ) jiraRequestUrl (restPath string , queryParams interface {}) (string , error ) {
36
+ queryParamsValues , err := query .Values (queryParams )
37
+ if err != nil {
38
+ return "" , err
39
+ }
40
+ u := api .restUrl .ResolveReference (& url.URL {Path : path .Join (api .restUrl .Path , restPath ), RawQuery : queryParamsValues .Encode ()})
41
+ return u .String (), err
42
+ }
0 commit comments