We have no idea what you mean by that it doesn't work correctly. What is correct in this case?
We have no idea what you mean by that it doesn't work correctly. What is correct in this case?
Post request is the same in Qt and in curl, but correct result is only in curl. Qt give wrong result, like paramtrs ware wrong (but i use the same parametrs in both cases).
And what kind of help do you expect from us? Apparently the two requests differ so take a network sniffer and find the difference.
I want from you to show me how correct configure POST request in QT, because now is somting wrong , the same result i get if i use GET request. Curl show correct result (using this parametrs "name=Gaths&password=qwerasdf&lowRes=1&login=13592 99878&w=") maybe in Qt is different way to do this
Get a network sniffer such as wireshark and find out differences between the two requests.
but i know, that parametrs are good and should work "name=Gaths&password=qwerasdf&lowRes=1&login=1 3592 99878&w="
name=Gaths
password=qwerasdf
lowRes=1
login=13592 99878
w=
And work, but in qt dont work(i do something wrong but i dont know what)
Get a network sniffer and find out differences between two requests. You are comparing unencoded body of the request which says nothing about what gets sent to the server. Don't guess what gets sent, check it using tools available. You will see many differences between the two requests, you need to find those that matter (e.g. content encoding header) and correct your request. Your "problem" comes from your apparent limited knowledge about HTTP so either you learn how HTTP works or you mimic a working request. The latter is certainly faster than the former, however you learn much more from the former than the latter.
thx for help (i use wireshark), i know what is wrong, it is problem with encoding.
POST parametrs from firefox IN WIRESHARK look like this:
"name=Gaths&password=qwerasdf&s1=Login&w=1024%3A60 0&login=1359443665"
but from qt POST look like this:
"6e616d234567843234356445678956774343..."
Can somebody tell me how correctli encode parametrs in qt ?? (my app code is in first post)
You need to provide proper encoding for the data.
http://en.wikipedia.org/wiki/POST_(HTTP)
It should probably be x-www-form-urlencoded but it looks like base64 now.
And by the way, I suggest you use QNetworkAccessManager rather than QHttp which has been deprecated for years.
Bookmarks