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. Unable to send HTTP GET request

Unable to send HTTP GET request

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 304 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
    abra
    wrote on last edited by
    #1

    I'm trying to send a simple HTTP GET request with a bearer token, and I can't for the life of me get it to work. It works fine with Postman, see attached screenshot.
    I've hid the URL and token as it's an internal service.

    Screenshot 2023-10-03 at 22.50.42.png

    Then I try to replicate this exactly using Qt 6.5 on my macOS 13.4, but my GET request just never finishes. Ie, my program is stuck in the reply->isFinished() blocking call. I know I should connect a slot to get notified async, but for testing purposes I added this blocking call. What's going on, it should be pretty straight forward. Could something in my OS be blocking network requests...?

    Screenshot 2023-10-03 at 22.56.16.png

    Christian EhrlicherC 1 Reply Last reply
    0
    • A abra

      I'm trying to send a simple HTTP GET request with a bearer token, and I can't for the life of me get it to work. It works fine with Postman, see attached screenshot.
      I've hid the URL and token as it's an internal service.

      Screenshot 2023-10-03 at 22.50.42.png

      Then I try to replicate this exactly using Qt 6.5 on my macOS 13.4, but my GET request just never finishes. Ie, my program is stuck in the reply->isFinished() blocking call. I know I should connect a slot to get notified async, but for testing purposes I added this blocking call. What's going on, it should be pretty straight forward. Could something in my OS be blocking network requests...?

      Screenshot 2023-10-03 at 22.56.16.png

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      @abra said in Unable to send HTTP GET request:

      know I should connect a slot to get notified async, but for testing purposes I added this blocking call.

      And why do you don't do that when you know it's not recommended? You are blocking the event loop so no network i/o. Use signals and slots.
      Also don't post images but code properly formatted with code tags so it is readable.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      A 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @abra said in Unable to send HTTP GET request:

        know I should connect a slot to get notified async, but for testing purposes I added this blocking call.

        And why do you don't do that when you know it's not recommended? You are blocking the event loop so no network i/o. Use signals and slots.
        Also don't post images but code properly formatted with code tags so it is readable.

        A Offline
        A Offline
        abra
        wrote on last edited by
        #3

        @Christian-Ehrlicher alright, stupid me, works now when I connected the finished signal to my slot...

        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