I am trying to pass this string as a get parameter. This string starts with the following characters :
string name is some_html it is basically some html
<p style=\"-qt-block-indent: 0; text-indent: 0px; margin: 18px 0px 12px 0px;\"><span style=\"font-size: xx-large;
However I only get this
<p style=\\"-qt-block-indent: 0
This is how I am passing the string:
http://127.0.0.1:8000/service_SubmitResult?htmlstring=some_html
Any idea on what I might be doing wrong. I am sending the string via Qt and receiving it on Django endpoint? I believe its because of the semicolon . I am using the following function for encoding the url before sending it out
QUrl ServiceCalls::UrlFromUserInput(const QString& input)
{
QByteArray latin = input.toLatin1();
QByteArray utf8 = input.toUtf8();
if (latin != utf8)
{
// URL string containing unicode characters (no percent encoding expected)
return QUrl::fromUserInput(input);
}
else
{
// URL string containing ASCII characters only (assume possible %-encoding)
return QUrl::fromUserInput(QUrl::fromPercentEncoding(input.toLatin1()));
}
}
Why am I receiving only a part of the string. On django i am getting the parameter value in the following way
def service_foo(request):
try:
htmlResult = request.GET.get('htmlstring', '')
....
return HttpResponse();
except Exception as e:
print(e)
return HttpResponse("Error Service from sqlite")
Any suggestions on how I can fix this or what other options i can use ?