I'm trying this package with a simple GET request to a local URL, but I get failure(HTTPClientError.cancelled).
Pasting the same URL in a web browser works.
I am sending the request from an init method in a ViewModel class. Should this work?
You can see my very basic code here:
https://github.com/mvolkmann/SwiftUI-AsyncHTTPClient/blob/main/SwiftUI-AsyncHTTPClient/ViewModel.swift
An instance of ViewModel is created in ContentView.swift which is here:
https://github.com/mvolkmann/SwiftUI-AsyncHTTPClient/blob/main/SwiftUI-AsyncHTTPClient/ContentView.swift
I'm trying this package with a simple GET request to a local URL, but I get
failure(HTTPClientError.cancelled).Pasting the same URL in a web browser works.
I am sending the request from an
initmethod in a ViewModel class. Should this work?You can see my very basic code here:
https://github.com/mvolkmann/SwiftUI-AsyncHTTPClient/blob/main/SwiftUI-AsyncHTTPClient/ViewModel.swift
An instance of ViewModel is created in
ContentView.swiftwhich is here:https://github.com/mvolkmann/SwiftUI-AsyncHTTPClient/blob/main/SwiftUI-AsyncHTTPClient/ContentView.swift