It's good you solved your problem, but I'd like to take the opportunity to recommend not sending actual SQL queries to the server. I see you're using https, but I still consider it an extreme security risk, what you're doing.
I'd recommend creating a real API on the server instead, that contains the queries and simply return the answers to the client.