@@ -246,7 +246,7 @@ func checkResponseStatus(r *http.Response) error {
246
246
return fmt .Errorf ("postman Request failed with status code: %d" , r .StatusCode )
247
247
}
248
248
249
- func (c * Client ) getPostmanReq (url string , headers map [string ]string ) (* http.Response , error ) {
249
+ func (c * Client ) getPostmanReq (ctx context. Context , url string , headers map [string ]string ) (* http.Response , error ) {
250
250
req , err := c .NewRequest (url , headers )
251
251
if err != nil {
252
252
return nil , err
@@ -257,6 +257,8 @@ func (c *Client) getPostmanReq(url string, headers map[string]string) (*http.Res
257
257
return nil , err
258
258
}
259
259
260
+ ctx .Logger ().V (4 ).Info ("postman api response headers are available" , "response_header" , resp .Header )
261
+
260
262
if err := checkResponseStatus (resp ); err != nil {
261
263
return nil , err
262
264
}
@@ -274,7 +276,7 @@ func (c *Client) EnumerateWorkspaces(ctx context.Context) ([]Workspace, error) {
274
276
if err := c .WorkspaceAndCollectionRateLimiter .Wait (ctx ); err != nil {
275
277
return nil , fmt .Errorf ("could not wait for rate limiter during workspaces enumeration getting: %w" , err )
276
278
}
277
- r , err := c .getPostmanReq ("https://api.getpostman.com/workspaces" , nil )
279
+ r , err := c .getPostmanReq (ctx , "https://api.getpostman.com/workspaces" , nil )
278
280
if err != nil {
279
281
return nil , fmt .Errorf ("could not get workspaces during enumeration: %w" , err )
280
282
}
@@ -313,7 +315,7 @@ func (c *Client) GetWorkspace(ctx context.Context, workspaceUUID string) (Worksp
313
315
if err := c .WorkspaceAndCollectionRateLimiter .Wait (ctx ); err != nil {
314
316
return Workspace {}, fmt .Errorf ("could not wait for rate limiter during workspace getting: %w" , err )
315
317
}
316
- r , err := c .getPostmanReq (url , nil )
318
+ r , err := c .getPostmanReq (ctx , url , nil )
317
319
if err != nil {
318
320
return Workspace {}, fmt .Errorf ("could not get workspace (%s): %w" , workspaceUUID , err )
319
321
}
@@ -341,7 +343,7 @@ func (c *Client) GetEnvironmentVariables(ctx context.Context, environment_uuid s
341
343
if err := c .GeneralRateLimiter .Wait (ctx ); err != nil {
342
344
return VariableData {}, fmt .Errorf ("could not wait for rate limiter during environment variable getting: %w" , err )
343
345
}
344
- r , err := c .getPostmanReq (url , nil )
346
+ r , err := c .getPostmanReq (ctx , url , nil )
345
347
if err != nil {
346
348
return VariableData {}, fmt .Errorf ("could not get env variables for environment (%s): %w" , environment_uuid , err )
347
349
}
@@ -368,7 +370,7 @@ func (c *Client) GetCollection(ctx context.Context, collection_uuid string) (Col
368
370
if err := c .WorkspaceAndCollectionRateLimiter .Wait (ctx ); err != nil {
369
371
return Collection {}, fmt .Errorf ("could not wait for rate limiter during collection getting: %w" , err )
370
372
}
371
- r , err := c .getPostmanReq (url , nil )
373
+ r , err := c .getPostmanReq (ctx , url , nil )
372
374
if err != nil {
373
375
return Collection {}, fmt .Errorf ("could not get collection (%s): %w" , collection_uuid , err )
374
376
}
0 commit comments