Unable to send large JSON to POST service via MQL5

 

Hi all, I am having trouble in sending JSON  (of length around 5000 character) to a POST service via MQL5. I tries sending small size JSON, it send perfectly and I can get it via following method in python:

requrstJSON = request.get_json()

However when I increase the size of JSON same method returns 'None'. Following is MQL5 code to call service:


void callService(string payload)
{
   uchar jsonData[];
   
   payload = "{\r\n" + "\"" + "Payload\":\"" + 
   //"value" 
   payload 
   + "\"" + "\r\n}";
       
   ArrayResize(jsonData, StringToCharArray(payload, jsonData, 0, WHOLE_ARRAY, CP_UTF8)-1); 
   
   string serverHeaders = "Content-Type: application/json";
   
   int res=WebRequest("POST", "http://127.0.0.1:5000/DoWork", serverHeaders, 0, jsonData, jsonData, serverHeaders);
}

Moreover I need to pass '\r\n'  (carriage return) in JSON, so for that which encoding I have to use for this purpose instead of 'CP_UTF8'.

Please help.