iosswiftmoya

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


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


Solution

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

    try this ?