Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Build RESTful API client example for WASM
Qt 6.11 is out! See what's new in the release blog

Build RESTful API client example for WASM

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
3 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    ahatstat
    wrote on last edited by
    #1

    I was able to build the RESTful API client example for desktop Linux Qt version 6.8.1, but when i tried to build it for WASM (single threaded) I got complaints about missing header files.

    fatal error: 'QtNetwork/qrestaccessmanager.h' file not found
    

    I used the network installer to install Qt. Indeed qrestaccessmanager.h is not in wasm_singlethread/include/QtNetwork/ nor are any http related header files. The file is found in other adjacent installations. Does that mean that http features are not supported for WASM single threaded builds?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ahatstat
      wrote on last edited by
      #2

      It appears that all http features are disabled in single threaded web assembly builds as seen here.

      qt_feature("http" PUBLIC
          SECTION "Networking"
          LABEL "HTTP"
          PURPOSE "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager."
          CONDITION QT_FEATURE_thread
      

      Bummer. Accessing a Restful API from a WASM application seems like a common use case. Other than switching to multithreaded (which requires https) any suggestions on porting the qrestaccessmanager to single threaded?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RandomGuy
        wrote on last edited by
        #3

        Strange, I know for a fact that QNetworkAccessManager works on wasm, so you may want to use that instead.

        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