Results 1 to 6 of 6

Thread: Sending information to server over an open HTTP connection

  1. #1
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Sending information to server over an open HTTP connection

    We are using QNetworkAccessManager to set up the GET request and use the returned QNetworkReply to read the data stream. This works fine.
    We tried to send extra information over this open connection by using the QNetworkReply::write method, but this fails as QNetworkReply is read-only.
    (We know that this is probably an HTTP limitation, but our application requires to do so.)

    Does anybody have an idea on how to send data over the open connection?

    (Context: We are building an Ntrip client. Communication to the server happens over HTTP. The server replies to the GET request with an ongoing stream of data. In Ntrip, the client can (repeatedly) send during this ongoing communication extra information to the server in order to finetune the data to be replied.)

  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: Sending information to server over an open HTTP connection

    Quote Originally Posted by Pieter from Belgium View Post
    In Ntrip, the client can (repeatedly) send during this ongoing communication extra information to the server in order to finetune the data to be replied.
    Using what protocol? GET does not allow any data past the header.
    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. #3
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending information to server over an open HTTP connection

    We use HTTP GET.

    We are hoping for a suggestion to bypass this restriction, as the application needs to send updates to the Ntrip caster.

  4. #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: Sending information to server over an open HTTP connection

    Could you post an example message exchange between a working server and client where the client transmits a request body with a GET request? In specific, how does the client inform the server about the length of such request body? What encoding does it use for the body?
    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.


  5. #5
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending information to server over an open HTTP connection

    The header:
    ------------------------------------
    GET /mountpoint HTTP/1.1
    Host: some.ntrip.caster
    Ntrip-Version: Ntrip/2.0
    User-Agent: NTRIP client X/1.0
    Connection: close
    -----------------------------------------
    <some time later>

    $GPGGA,135155.00,5050.89389,N,00443.90698,E,5,19,0 .6,81.53,M,47.39,M,27.9,0268*46

  6. #6
    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: Sending information to server over an open HTTP connection

    How does the server determine where the request ends?

    Basically I think your only choice is to implement your own client from scratch based on QTcpSocket as what you require does not conform to HTTP/1.1 standards. The syntax is fine but the semantics are not, QNetworkAccessManager is not going to handle that for you without heavy workarounds.
    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.


Similar Threads

  1. Replies: 0
    Last Post: 11th November 2011, 20:18
  2. Replies: 2
    Last Post: 10th June 2011, 14:49
  3. [TCP Server] Server only sending when terminating
    By papperlapapp in forum Qt Programming
    Replies: 0
    Last Post: 6th December 2010, 20:41
  4. Sending MIME over HTTP
    By Septi in forum Qt Programming
    Replies: 3
    Last Post: 2nd December 2010, 10:14
  5. Replies: 1
    Last Post: 2nd April 2010, 07:42

Tags for this Thread

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.