Home > Software engineering >  How to build Http Request with IP address in Swift?(Moya)
How to build Http Request with IP address in Swift?(Moya)

Time:12-15

Can I build Http Request with ip address?

I try change url string:

    var baseURL: URL {
        return URL.init(string:("http://github.com/apple/swift"))!
    }

to

    var baseURL: URL {
        return URL.init(string:("http://140.82.113.3/apple/swift"))!
    }

But, Network not working :(

CodePudding user response:

var baseURL: URL = URL(string: "http://github.com/apple/swift")

try this ?

  • Related