Results 1 to 8 of 8

Thread: Login to www.getfile.pl

  1. #1
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Login to www.getfile.pl

    Hi,
    I want to login to getfile.pl and download content of webpage as logged user.
    This is API http://getfile.pl/article_9_API
    And my code
    QHttpRequestHeader header("POST", "/api.php");;
    header.setValue("Host", "www.getfile.pl");
    header.setValue("Get","mode=login");
    header.setContentType("application/x-www-form-urlencoded");
    QString loginString = "login=login&password=pass";
    m_http->setHost("www.getfile.pl");
    m_http->request(header, loginString.toUtf8());
    But this code is bad...


    This is response serwer:
    HTTP/1.1 302 Found
    Date: Sat, 08 Aug 2009 21:57:49 GMT
    Server: Apache/2
    Set-Cookie: PHPSESSID=sn9j1hfp13hp35efqs9bq8ved2; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: PHPSESSID=sn9j1hfp13hp35efqs9bq8ved2; expires=Sat, 08-Aug-2009 22:27:49 GMT; path=/; domain=getfile.pl
    Set-Cookie: PHPSESSID=sn9j1hfp13hp35efqs9bq8ved2; expires=Sat, 08-Aug-2009 22:27:49 GMT; path=/; domain=ssl.getfile.pl
    Connection: close
    location: http://getfile.pl/
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    Please help me
    PS: Sorry for my terrible English...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Login to www.getfile.pl

    But what exactly do you want us to do? The server responds with a regular cached response, you probably didn't send a proper request.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    oski225 (20th August 2009)

  4. #3
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Login to www.getfile.pl

    In this moment I want to get webpage as logged user.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Login to www.getfile.pl

    Ok, but how do you think we could help you? Right now I can only advise to take a network sniffer, check the traffic expected by the webserver (for example as sent by a web browser) and compare it to the one of your program. Then change your program to emit a proper request to the server.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    oski225 (20th August 2009)

  7. #5
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Login to www.getfile.pl

    But I do like is written in the API, although it does not refer the server log whether I was successful or not

  8. #6
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Login to www.getfile.pl

    Please give me example login to forum/site

  9. #7
    Join Date
    Jul 2009
    Posts
    139
    Thanks
    13
    Thanked 59 Times in 52 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Login to www.getfile.pl

    Why do you say it is not working? The response sets cookies and redirects to getfile.pl. The problem may be that QHttp does not automatically handle cookies. Why don't you use QNetworkAccessManager instead, which handles cookies?

  10. The following user says thank you to numbat for this useful post:

    oski225 (20th August 2009)

  11. #8
    Join Date
    Aug 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Login to www.getfile.pl

    Ok, big thx

Similar Threads

  1. Suggestions on Login Prompt
    By fnmblot in forum Qt Programming
    Replies: 9
    Last Post: 22nd May 2009, 19:54
  2. Login Problem
    By srichand in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2008, 12:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.