1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:21:37 -07:00

doc: add http.NoBody and Transport change to go1.8.html

Fixes #18257

Change-Id: Iafba5aa0a0641cfe36351bb0e4b57f20257fdc4e
Reviewed-on: https://go-review.googlesource.com/34210
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2016-12-08 23:49:54 +00:00
parent 00efa446e1
commit 9ad47c4f67

View File

@ -1320,6 +1320,22 @@ crypto/x509: return error for missing SerialNumber (CL 27238)
to use IPv4 as a backup if it looks like IPv6 might be
failing.
</li>
<li> <!-- CL 31726 -->
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
no longer reads a byte of a non-nil
<a href="/pkg/net/http/#Request.Body"><code>Request.Body</code></a>
when the
<a href="/pkg/net/http/#Request.ContentLength"><code>Request.ContentLength</code></a>
is zero to determine whether the <code>ContentLength</code>
is actually zero or just undefined.
To explicitly signal that a body has zero length,
either set it to <code>nil</code>, or set it to the new value
<a href="/pkg/net/http/#NoBody"><code>NoBody</code></a>.
The new <code>NoBody</code> value is intended for use by <code>Request</code>
constructor functions; it is used by
<a href="/pkg/net/http/#NewRequest"><code>NewRequest</code></a>.
</li>
</ul>
</dd>