One thing worth checking.
In your http_send code, you have VERSION: 2 specified in your header.
In your MQL4 code, you don't, which I think causes it to default to the latest version, i.e. VERSION: 3.

Also looking at the specification for V2 vs V3, the input body for V3 also has a field for
encryptedPassword, which is not there in V3.
https://labs.ig.com/rest-trading-api-reference/service-detail?id=534