Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can we parse HTTP response header fields using Qt/C++?
    primarykey
    data
    text
    <p>I am writing a piece of software that uses Qt/KDE libs. The objective is to parse the HTTP header response fields into different fields of a struct. So far the HTTP header response is contained in a QString. </p> <p>It looks something like this:</p> <pre><code>"HTTP/1.1 302 Found date: Tue, 05 Jun 2012 07:40:16 GMT server: Apache/2.2.22 (Linux/SUSE) x-prefix: 49.244.80.0/21 x-as: 23752 x-mirrorbrain-mirror: mirror.averse.net x-mirrorbrain-realm: region link: &lt;http://download.services.openoffice.org/files/du.list.meta4&gt;; rel=describedby; type="application/metalink4+xml" link: &lt;http://download.services.openoffice.org/files/du.list.torrent&gt;; rel=describedby; type="application/x-bittorrent" link: &lt;http://mirror.averse.net/openoffice/du.list&gt;; rel=duplicate; pri=1; geo=sg link: &lt;http://ftp.isu.edu.tw/pub/OpenOffice/du.list&gt;; rel=duplicate; pri=2; geo=tw link: &lt;http://ftp.twaren.net/OpenOffice/du.list&gt;; rel=duplicate; pri=3; geo=tw link: &lt;http://mirror.yongbok.net/openoffice/du.list&gt;; rel=duplicate; pri=4; geo=kr link: &lt;http://ftp.kaist.ac.kr/openoffice/du.list&gt;; rel=duplicate; pri=5; geo=kr digest: MD5=b+zfBEizuD8eXZUTWJ47xg== digest: SHA=A5zw6PkywlhiPlFfjca+gqIGLHA= digest: SHA-256=HOrd0MMBzS8Ctljpe4PauwStijsnBKaa3gXO4L30eiA= location: http://mirror.averse.net/openoffice/du.list content-length: 329 connection: close content-type: text/html; charset=iso-8859-1" </code></pre> <p>In addition to the custom fields there might be few more fields in the header response. The only possible way that I came up was to manually search for the fields like "link", "digest" and others and create a QMap with the fields as keys.However, I guess there must be a better way to do this. I would be thankful to you if you could help me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload