Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. https nodejs server resolve wrong body data from QHttpMultiPart
Forum Updated to NodeBB v4.3 + New Features

https nodejs server resolve wrong body data from QHttpMultiPart

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 309 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    webberg
    wrote on last edited by webberg
    #1

    Hi,
    I write a https server with nodejs. It works fine when I use JMeter to test the ability of file uploading. And I can get the token from body. But when I post only token through QHttpMultiPart I get the wrong body property: req.body."--boundary_.oOo._MTc5MTk"= "Mjg5Mzc=MzE0OTA=Content-Disposition: form-data;na". Here "--boundary_.oOo._MTc5MTk" is parsed to the only property of body. I used Qt5.7.1. Here is my code for test and recieve same results as describes:

    QHttpMultiPart* pMutipart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
    QHttpPart partParams;
    partParams.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data;name=\"hello\""));
    partParams.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/plain"));
    partParams.setBody("world");
    pMutipart->append(partParams);
    m_pManager->post(m_request, pMutipart);
    

    Does these code have any wrong?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved