How to build Http Request with IP address in Swift?(Moya)

750 Views Asked by At

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 :(

1

There are 1 best solutions below

22
Jok3r On BEST ANSWER
var baseURL: URL = URL(string: "http://github.com/apple/swift")

try this ?