Internal function to make HTTP requests to IG API
.ig_request(
path,
auth,
method = c("GET", "POST", "PUT", "DELETE"),
query = list(),
body = NULL,
version = NULL,
mock_response = NULL
)List with API response (status code and body) or tibble if mock_response is a data frame.
Character. API endpoint path (e.g., "/positions/otc").
List. Authentication details from ig_auth().
Character. HTTP method ("GET", "POST", "PUT", "DELETE").
List. Query parameters for GET requests. Defaults to list().
List. Request body for POST or PUT requests. Defaults to NULL.
Character. API version ("1", "2", "3"). Defaults to NULL.
List or data frame. Optional mock response for testing, bypassing the API call.