Skip to content

Conversation

@mikitaVeliasevich
Copy link

Summary

This PR adds response headers support to ServerResponse and BatchOrderServerResponse structs to enable rate limit tracking from API responses.

Changes

  • Added Headers http.Header field to ServerResponse struct
  • Added Headers http.Header field to BatchOrderServerResponse struct
  • Modified callAPI to return response headers
  • Updated SendRequest to return headers
  • Updated GetServerResponse and GetBatchOrderServerResponse to accept and populate headers
  • Updated all API methods to pass headers through the call chain

Use Case

This enables tracking rate limits from response headers in methods like PlaceOrder, AmendOrder, CancelOrder, and batch order operations.

Example usage:
resp, err := client.PlaceOrder(ctx, opts...)
rateLimitRemaining := resp.Headers.Get("X-RateLimit-Remaining")## Testing

  • All existing tests pass
  • No breaking changes to existing API

…sponse

- Add Headers field to ServerResponse struct for rate limit tracking
- Add Headers field to BatchOrderServerResponse struct
- Modify callAPI to return response headers
- Update SendRequest to return headers
- Update GetServerResponse and GetBatchOrderServerResponse to accept and populate headers
- Update all API methods to pass headers through the call chain
- Enables tracking rate limits from response headers in PlaceOrder, AmendOrder, CancelOrder, and batch order operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant