You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
let eventLoopGroup = MultiThreadedEventLoopGroup(numThreads: 1)
let eventLoop = eventLoopGroup.next()
let client = try! HTTPClient.connect(hostname: "ipinfo.io", on: eventLoop).wait()
let httpReq = HTTPRequest(method: .GET, url: "/8.8.8.8")
let httpRes = try! client.send(httpReq).wait()
print(httpRes)
I received:
Date: Thu, 07 Jun 2018 10:10:34 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 47
X-Powered-By: Express
x-cloud-trace-context: e942dcd1f79372a1b17f146831abb7df/9141077538359615180;o=0
Access-Control-Allow-Origin: *
Location: https://ipinfo.io/8.8.8.8
Vary: Accept
Via: 1.1 google
Found. Redirecting to https://ipinfo.io/8.8.8.8
What I am doing wrong?
The text was updated successfully, but these errors were encountered:
The server returned a redirect to https://ipinfo.io/8.8.8.8 which HTTPClient didn't even try to follow. I don't know if it's supposed to do so currently. If so: you ran into a bug; or if not, this would be a useful feature to have.
let client = try! HTTPClient.connect(scheme: .https, hostname: "ipinfo.io", on: eventLoop).wait()
But during execution of the code, I got:
Fatal error: 'try!' expression unexpectedly raised an error: NIOOpenSSL.OpenSSLError.uncleanShutdown: file /home/buildnode/jenkins/workspace/oss-swift-4.1-package-linux-ubuntu-16_04/swift/stdlib/public/core/ErrorType.swift, line 184
My system:
$ cat /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
$ swift --version
Swift version 4.1.2 (swift-4.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
I need to get result of:
My code:
I received:
What I am doing wrong?
The text was updated successfully, but these errors were encountered: