title: Lose chunk of my data when i try to send image in QByteArray via QNetworkAccessManager in json
body: <p>I compared the data i send and recieve and it is turned out that the end of my data, which i recieve on my server is cut, is QNetworkmanager has a request lenght limit?</p>
  
  <p>photo struct.</p>
  
  <pre><code>typedef struct Photo_{
      std::string name;
      int likes;
      int comments;
      int id;
      int user_id;
  QByteArray img_in_bytes;
  }photo;
  </code></pre>
  
  <p>Here is the function that convert data to json and send it to server.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>void MainWindow::send_new_photo_to_server(photo item){
      QJsonDocument doc;
  
      QNetworkRequest req(url);
  
      qDebug() &lt;&lt; QString::number(item.likes);
      qDebug() &lt;&lt; QString::number(item.comments);
      qDebug() &lt;&lt; QString::fromStdString(item.name);
  
      req.setHeader(QNetworkRequest::ContentTypeHeader, "text");
      req.setRawHeader("request-type", "addMainEntity");
  
      QBuffer buf(&amp;item.img_in_bytes);
      QByteArray img_in_bytes = buf.data().toBase64();
  
      QJsonObject object;
  
      object.insert("comments", QString::number(item.comments));
      object.insert("img_in_bytes",QLatin1String(img_in_bytes));
      object.insert("name", QString::fromStdString(item.name));
      object.insert("likes", QString::number(item.likes));
  
      doc.setObject(object);
  
      qDebug() &lt;&lt; doc.toJson();
  
      manager-&gt;post(req, doc.toJson());
  
      qDebug() &lt;&lt; "here you are";
  }
  </code></pre>
  
  <p>There is function that handle a request. It`s no need in upload procces function becouse data has already been currupted by the time it is called. </p>
  
  <pre class="lang-cpp prettyprint-override"><code>void Server::get_request(){
  
      i++;
      qDebug() &lt;&lt; i &lt;&lt; "\n";
  
      QTcpSocket* socket = qobject_cast&lt;QTcpSocket*&gt;(sender());
  
      QString data = socket-&gt;readAll();
  
      socket-&gt;waitForBytesWritten(3000);
      qDebug() &lt;&lt; "Recieved data: \n" &lt;&lt; data;
  
      this-&gt;process_request(data);
  }
  </code></pre>