Alamofire of failure to obtain data on request



  • Alamofire.request(
    .GET,
    "http://localhost:9080/feed", parameters: [:])
    .responseJSON { response in
        guard response.result.isSuccess else {
        print("Error while fetching: (response.result.error)")
        return
    }
    

    Mistake: Code=-1004 "Could not connect to the server."

    Starting the server on Swift, the server works, the browser gives the test data on the way." http://localhost:9080/feed ♪

    AllowArbitraryLoads = Yes
    

    response.result.value = nil



  • Supported the following:

    performed sudo ifconfig. It's been shown that I've had a design.

    inet6 fe80:61e:64ff:fef8:4c2e%en1 prefixlen 64 scopeid 0x5 inet 192.168.0.20 netmask 0xffff00 broadcast 192.168.0.255

    It therefore wrote 192.168.0.20 (instead of localhost or 127.0.0.1)


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2