Skip to content

http/1.1 and http/2 #58

@eraserx99

Description

@eraserx99

Supposedly, the newer version GO (I'm using GO 1.14.9) would use http/2 with TLS by default on the client-side when the server-side supports http/2. I expect to see HTTP/2 getting logged on the server-side when I use the following code (gentleman.V2 2.0.4)

cli := gentleman.New()
cli.URL("https://mytestserver.com")
cli.Request().Send()

However, I got this logged on the server-side,

[12/Oct/2020:15:43:03 +0000] "GET / HTTP/1.1" 200 14195 "-" "gentleman/2.0.4"

If I do this,

cli := gentleman.New()
cli.Use(transport.Set(http.DefaultTransport))
cli.URL("https://mytestserver.com")
cli.Request().Send()

I got this logged on the server-side,

[12/Oct/2020:15:58:12 +0000] "GET / HTTP/2.0" 200 14175 "-" "gentleman/2.0.4"

Of course, a simple call from the http package like below also got HTTP/2.0 logged on the server-side,

http.Get("https://mytestserver.com")

I've not found the gentleman documentation about this behavior (probably, I'm not thorough enough).

Any comments?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions