+ myMainw->setLabelInfoToUser("Sending result to server");
+
+ xmlbuffer->close();
+}
+
+/**
+ *@brief Sends route to the server in xml format.
+ *Send authentication information in the header.
+ *@todo Check destination URL.
+ */
+void HttpClient::sendRouteXml()
+{
+ qDebug() << "_sendResultXml";
+
+ QBuffer *xmlbuffer = new QBuffer();
+
+ QUrl qurl("http://api.speedfreak-app.com/api/update/route");
+ qDebug() << qurl.toString();
+ QNetworkRequest request(qurl);
+ QNetworkReply *currentDownload;
+
+ xmlbuffer->open(QBuffer::ReadWrite);
+ myXmlwriter->writeGpsTrack(xmlbuffer, myMainw->gpsData->getGpsDataArray(), myMainw->gpsData->getRoundCounter());
+ qDebug() << "carmainwindow: xmlbuffer->data(): " << xmlbuffer->data();
+
+ QString credentials = myMainw->myLogin->getUserName() + ":" + myMainw->myLogin->getPassword();
+ credentials = "Basic " + credentials.toAscii().toBase64();
+ request.setRawHeader(QByteArray("Authorization"),credentials.toAscii());
+
+ currentDownload = netManager->post(request, ("xml=" + xmlbuffer->data()));
+ connect(currentDownload,SIGNAL(finished()),this,SLOT(ackOfRoute()));
+ //connect(currentDownload,SIGNAL(error(QNetworkReply::NetworkError)),myMainw,SLOT(errorFromServer(QNetworkReply::NetworkError)));
+ myMainw->setLabelInfoToUser("Sending route to server");