Results 1 to 4 of 4

Thread: Sending MIME over HTTP

  1. #1
    Join Date
    Jul 2010
    Posts
    12
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Sending MIME over HTTP

    So, I need to do just that. I see there's QMimeData class out there, I can create mime data with it, but I see no way to extract it as plain data (as in QByteArray), to send it in HTTP POST request. Please point me in the right direction

  2. #2
    Join Date
    Mar 2008
    Location
    Marslev, Denmark
    Posts
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Sending MIME over HTTP

    You can't do that directly. But if you call QByteArray::toBase64() you get a string of ascii characters that can be sent.
    Bo Thorsen, Viking Software
    Qt applications on Linux and Windows

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

    Septi (2nd December 2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    12
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sending MIME over HTTP

    I see... But AFAIK, the base64-coded data isn't all I need. Do you know any library I could use to write MIME?

  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: Sending MIME over HTTP

    You don't need any library. mime-type only informs the other end of communication what kind of data is being sent. Then you just send the actual data in the format you declared with the mime-type. "MIME" is not any kind of special format on its own. If you have a png image then its mime-type is image/png, if you have an mp3 file then its mime-type is audio/mp3, if you have custom binary data then the mime-type is application/octet-stream, simple text is text/plain, etc. You declare the type of the data and not convert the data to the mime type.
    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. Phonon Mime Type
    By somnathbanik in forum Newbie
    Replies: 0
    Last Post: 20th November 2010, 11:02
  2. qt with mime.type and mail.cap
    By killerwookie99 in forum Qt Programming
    Replies: 0
    Last Post: 16th September 2008, 22:39
  3. MIME and KDE
    By fullmetalcoder in forum KDE Forum
    Replies: 5
    Last Post: 2nd February 2007, 20:38
  4. MIME and .desktop files in KDE
    By nupul in forum KDE Forum
    Replies: 4
    Last Post: 14th April 2006, 16:30
  5. MIME database and QMimedata
    By nupul in forum Qt Programming
    Replies: 12
    Last Post: 12th April 2006, 14:36

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.