From d62a5f0786aac573f6aae3f687b9ce772255f24f Mon Sep 17 00:00:00 2001 From: fangdingjun Date: Thu, 19 Jul 2018 10:44:06 +0800 Subject: [PATCH] update doc --- doc.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc.go b/doc.go index a35e952..5f0ccb2 100644 --- a/doc.go +++ b/doc.go @@ -53,7 +53,9 @@ client example t.Fatal(err) } defer conn.Close() - + if err := conn.Handshake(); err != nil{ + t.Fatal(err) + } cstate := conn.ConnectionState() if cstate.NegotiatedProtocol != "h2" { t.Fatal("no http2 on server") @@ -77,7 +79,7 @@ client example req.Header.Set("user-agent", "go-nghttp2/1.0") req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - res, err := h2conn.CreateRequest(req) + res, err := h2conn.RoundTrip(req) if err != nil { t.Fatal(err) }