Results 1 to 3 of 3

Thread: Handle specific URL with QHttp

  1. #1
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Handle specific URL with QHttp

    Hello there !

    I use Videolan to record some streaming channels, and I have designed a Qt application
    to program those records...with a time to start & a time to stop.

    So, each time I have a new record to start, I launch a vlc through a QProcess, and it works great.

    My problem is the shutdown...basically, I have 2 options :
    - dirty : I kill the QProcess (and vlc then)
    - cool : I send an http request to vlc, to order him to shutdown properly.

    The URL is this one : "http://127.0.0.1/admin/?control=shutdown"
    But, the admin section requires a login : pass (admin:admin).

    So, I have to login before sending this url...and I'd like to do it with QHttp.

    I tried this "http://admin:admin@127.0.0.1/admin/?control=shutdown", but I feel it's not the good way.

    Any idea ?

    Thanks in advance,
    Guilugi.

  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: Handle specific URL with QHttp

    Sure Take a look at QHttp::setUser(). If that's not enough for you, you can use QHttpRequestHeader to set a custom header of your choice.

  3. #3
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Handle specific URL with QHttp

    Thanks Wysota for your answer !

    I found another way, very simple, and clean
    I enabled a TCP interface on vlc, and I connect to it with a QTcpSocket...
    All I have to do is write "quit\n", and vlc shutdowns perfectly.

    But, I'll try your method.

    Thanks again,
    Guilugi.

Similar Threads

  1. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41

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.