@@ -135,6 +135,30 @@ func (c *Client) newRequest(method, endpoint string, in interface{}) (*http.Requ
135
135
return req , nil
136
136
}
137
137
138
+ func (c * Client ) rawRequest (method , endpoint string , in interface {}) (* http.Request , error ) {
139
+ var bodyreader io.Reader
140
+
141
+ if in != nil {
142
+ newbodyreader , err := c .encodeOrError (in )
143
+ if err != nil {
144
+ return nil , err
145
+ }
146
+ bodyreader = newbodyreader
147
+ }
148
+
149
+ req , err := http .NewRequest (method , c .Endpoint + endpoint , bodyreader )
150
+ if err != nil {
151
+ return nil , err
152
+ }
153
+
154
+ req .Header .Add ("Content-Type" , "application/json" )
155
+ req .Header .Add ("Authorization" , fmt .Sprintf ("Bearer %s" , c .AuthToken ))
156
+ req .Close = true
157
+
158
+ return req , nil
159
+
160
+ }
161
+
138
162
func (c * Client ) doWithQuery (method string , endpoint string , out interface {}, in interface {}, query QueryArgs ) error {
139
163
request , err := c .newRequest (method , endpoint , in )
140
164
if err != nil {
@@ -168,6 +192,15 @@ func (c *Client) doWithPagination(method, endpoint string, out, in interface{})
168
192
return c .sendGetLink (request , out )
169
193
}
170
194
195
+ //rawWithPagination is used when we need to get a raw URL vs a url we combine and comb with newrequest
196
+ func (c * Client ) rawWithPagination (method , endpoint string , out , in interface {}) (* Link , error ) {
197
+ request , err := c .rawRequest (method , endpoint , in )
198
+ if err != nil {
199
+ return nil , err
200
+ }
201
+ return c .sendGetLink (request , out )
202
+ }
203
+
171
204
func (c * Client ) fetchLink (r * http.Response ) * Link {
172
205
link := & Link {}
173
206
if r .Header .Get ("Link" ) != "" {
0 commit comments