Results 1 to 10 of 10

Thread: QHttp Response content

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    91
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QHttp Response content

    Here are the headers from browser and my application

    Browser packets
    Header:

    POST /jspui/submit HTTP/1.1
    Host localhost:8080
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language en-us,en;q=0.5
    Accept-Encoding gzip,deflate
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive 300
    Connection keep-alive
    Referer http://localhost:8080/jspui/submit
    Cookie JSESSIONID=696FF5F9F3FFE011DCD4662AEAC0BCF8
    Content-Type multipart/form-data; boundary=---------------------------210982431416320
    Content-Length 1161


    Post-Data

    -----------------------------210982431416320
    Content-Disposition: form-data; name="workspace_item_id"

    193
    -----------------------------210982431416320
    Content-Disposition: form-data; name="step"

    3
    -----------------------------210982431416320
    Content-Disposition: form-data; name="page"

    1
    -----------------------------210982431416320
    Content-Disposition: form-data; name="jsp"

    /submit/choose-file.jsp
    -----------------------------210982431416320
    Content-Disposition: form-data; name="file"; filename="essay.txt"
    Content-Type: text/plain

    This is a test file.
    -----------------------------210982431416320
    Content-Disposition: form-data; name="workspace_item_id"

    193
    -----------------------------210982431416320
    Content-Disposition: form-data; name="step"

    3
    -----------------------------210982431416320
    Content-Disposition: form-data; name="page"

    1
    -----------------------------210982431416320
    Content-Disposition: form-data; name="jsp"

    /submit/choose-file.jsp
    -----------------------------210982431416320
    Content-Disposition: form-data; name="submit_upload"

    Next >
    -----------------------------210982431416320--
    My Application
    Header

    POST /jspui/submit HTTP/1.1
    Host: localhost:8080
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://localhost:8080/jspui/submit
    Cookie: JSESSIONID=07B22972405E63E712CC957FEDC28647
    content-type: multipart/form-data; boundary=--AaB03x
    content-length: 765

    Post data

    --AaB03x
    Content-Disposition: form-data; name="workspace_item_id"

    194
    --AaB03x
    Content-Disposition: form-data; name="step"

    3
    --AaB03x
    Content-Disposition: form-data; name="page"

    1
    --AaB03x
    Content-Disposition: form-data; name="jsp"

    /submit/choose-file.jsp
    --AaB03x
    Content-Disposition: form-data; name="file"; filename="essay.txt"
    Content-Type: text/plain

    This is a test file.
    --AaB03x
    Content-Disposition: form-data; name="workspace_item_id"

    194
    --AaB03x
    Content-Disposition: form-data; name="step"

    3
    --AaB03x
    Content-Disposition: form-data; name="page"

    1
    --AaB03x
    Content-Disposition: form-data; name="jsp"

    /submit/choose-file.jsp
    --AaB03x
    Content-Disposition: form-data; name="submit_upload"

    Next >
    --AaB03x--

    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

  2. #2
    Join Date
    Feb 2006
    Posts
    91
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QHttp Response content

    Ok, after banging my head for another day, I still can't figure out if I am doing anything wrong. I realized that I am using Qt 4.5.2 so it could very well be a bug.

    In Qt 4.5.3 change log I see this

    QNetworkAccessManager
    * [256240] Proper handling of HTTP redirect in AlwaysCache mode.
    * [257662] Fix timing issues that could trigger double sending of an
    HTTP request.
    Please suggest if these bugs were related to QHttp too ? Should I use QNetworkAccessManager instead with the latest version 4.5.3 ?
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

  3. #3
    Join Date
    Oct 2009
    Posts
    37
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11
    Thanked 4 Times in 4 Posts

    Default Re: QHttp Response content

    Quote Originally Posted by ct View Post
    Please suggest if these bugs were related to QHttp too ?
    they were not.

    Quote Originally Posted by ct View Post
    Should I use QNetworkAccessManager instead with the latest version 4.5.3 ?
    yes QHttp is deprecated with the soon to be released Qt 4.6.
    Disclaimer: Although I work on Qt for Nokia, anything I post here is personal

  4. #4
    Join Date
    Feb 2006
    Posts
    91
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QHttp Response content

    I used curl and now everything is fine. This is how curl sent it's header

    Curl trace file:

    => Send header, 322 bytes (0x142)
    0000: POST /jspui/submit HTTP/1.1
    001d: User-Agent: curl/7.19.5 (i586-pc-mingw32msvc) libcurl/7.19.5 zli
    005d: b/1.2.3
    0066: Host: localhost:8080
    007c: Accept: */*
    0089: Cookie: JSESSIONID=C03B80796C0718E4CB5CA174422DD9FB
    00be: Content-Length: 1139
    00d4: Expect: 100-continue
    00ea: Content-Type: multipart/form-data; boundary=--------------------
    012a: --------13c11370a722
    0140:
    <= Recv header, 23 bytes (0x17)
    0000: HTTP/1.1 100 Continue
    => Send data, 551 bytes (0x227)
    0000: ------------------------------13c11370a722
    002c: Content-Disposition: form-data; name="workspace_item_id"
    0066:
    0068: 421
    006d: ------------------------------13c11370a722
    0099: Content-Disposition: form-data; name="step"
    00c6:
    00c8: 3
    00cb: ------------------------------13c11370a722
    00f7: Content-Disposition: form-data; name="page"
    0124:
    0126: 1
    0129: ------------------------------13c11370a722
    0155: Content-Disposition: form-data; name="jsp"
    0181:
    0183: /submit/choose-file.jsp
    019c: ------------------------------13c11370a722
    01c8: Content-Disposition: form-data; name="file"; filename="essay.txt
    0208: "
    020b: Content-Type: text/plain
    0225:
    => Send data, 20 bytes (0x14)
    0000: This is a test file.
    => Send data, 568 bytes (0x238)
    0000:
    0002: ------------------------------13c11370a722
    002e: Content-Disposition: form-data; name="workspace_item_id"
    0068:
    006a: 421
    006f: ------------------------------13c11370a722
    009b: Content-Disposition: form-data; name="step"
    00c8:
    00ca: 3
    00cd: ------------------------------13c11370a722
    00f9: Content-Disposition: form-data; name="page"
    0126:
    0128: 1
    012b: ------------------------------13c11370a722
    0157: Content-Disposition: form-data; name="jsp"
    0183:
    0185: /submit/choose-file.jsp
    019e: ------------------------------13c11370a722
    01ca: Content-Disposition: form-data; name="submit_upload"
    0200:
    0202: Next >
    020a: ------------------------------13c11370a722--
    <= Recv header, 17 bytes (0x11)
    0000: HTTP/1.1 200 OK
    <= Recv header, 27 bytes (0x1b)
    0000: Server: Apache-Coyote/1.1
    <= Recv header, 40 bytes (0x28)
    0000: expires: Thu, 01 Jan 1970 00:00:00 GMT
    <= Recv header, 18 bytes (0x12)
    0000: Pragma: no-cache
    <= Recv header, 25 bytes (0x19)
    0000: Cache-control: no-store
    <= Recv header, 39 bytes (0x27)
    0000: Content-Type: text/html;charset=UTF-8
    <= Recv header, 22 bytes (0x16)
    0000: Content-Language: en
    <= Recv header, 28 bytes (0x1c)
    0000: Transfer-Encoding: chunked
    <= Recv header, 37 bytes (0x25)
    0000: Date: Tue, 03 Nov 2009 16:41:43 GMT
    <= Recv header, 2 bytes (0x2)
    0000:
    For QHttp too I did receive 200 OK response..but the file was not uploaded. What is it that curl is doing different so that the file gets uploaded ?
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

  5. #5
    Join Date
    Feb 2006
    Posts
    91
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: QHttp Response content

    The only difference I see is Expect: , could it be this ?
    Humans make mistake because there is really NO patch for HUMAN STUPIDITY

Similar Threads

  1. QHTTP does not see tunneled TCP HTTP OK authentication response
    By SailingDreams in forum Qt Programming
    Replies: 6
    Last Post: 23rd May 2009, 10:39
  2. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 11:41
  3. QHttp with localhost.
    By William Wilson in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2007, 21:26
  4. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 12:19
  5. Help with QHttp needed.
    By bitChanger in forum Qt Programming
    Replies: 5
    Last Post: 25th January 2006, 22:09

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
  •  
Qt is a trademark of The Qt Company.