Q1: How do I start the server inside of the terminal to keep track of the HTTP Responses
Q2: When I click fetchPost I see the following message inside of the console
-------------------------------------------------------------------------------------------
Attempt to fetch post while unauthorized
2019-11-05 14:00:24.356821+0100 hylonet[17181:798089] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
2019-11-05 14:00:24.356955+0100 hylonet[17181:798089] Cannot start load of Task <6E8CD21B-7819-401C-8BA3-3CE2A243F999>.<1> since it does not conform to ATS policy
2019-11-05 14:00:24.410710+0100 hylonet[17181:798085] Task <6E8CD21B-7819-401C-8BA3-3CE2A243F999>.<1> finished with error [-1022] Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x6000013f5830 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://localhost:1337/post, NSErrorFailingURLKey=http://localhost:1337/post, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}
Failed to hit server: Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded because the App Transport Security policy requires the use of a secure connection." UserInfo={NSUnderlyingError=0x6000013f5830 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}, NSErrorFailingURLStringKey=http://localhost:1337/post, NSErrorFailingURLKey=http://localhost:1337/post, NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.}
------------------------------------------------------------------------------------------
Thats why I added following property into the list
App Transport Security Settings
> Allow Local Networking : YES
When I restart the app I get the following error
------------------------------------------------------------------------------------------
Attempt to fetch post while unauthorized
2019-11-05 14:08:01.746572+0100 hylonet[17372:809381] [] nw_socket_handle_socket_event [C1.1:2] Socket SO_ERROR [61: Connection refused]
2019-11-05 14:08:01.748205+0100 hylonet[17372:809381] [] nw_socket_handle_socket_event [C1.2:2] Socket SO_ERROR [61: Connection refused]
2019-11-05 14:08:01.749220+0100 hylonet[17372:809381] Connection 1: received failure notification
2019-11-05 14:08:01.749403+0100 hylonet[17372:809381] Connection 1: failed to connect 1:61, reason -1
2019-11-05 14:08:01.749519+0100 hylonet[17372:809381] Connection 1: encountered error(1:61)
2019-11-05 14:08:01.755602+0100 hylonet[17372:809381] Task <55711CE6-C370-4D90-8361-9D54F033A32F>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61])
2019-11-05 14:08:01.762740+0100 hylonet[17372:809378] Task <55711CE6-C370-4D90-8361-9D54F033A32F>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x6000019ba1f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://localhost:1337/post, NSErrorFailingURLKey=http://localhost:1337/post, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
Failed to hit server: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x6000019ba1f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=http://localhost:1337/post, NSErrorFailingURLKey=http://localhost:1337/post, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
------------------------------------------------------------------------------------------
What can I do the fix this?