Skip to content

Commit

Permalink
doc: add http.NoBody and Transport change to go1.8.html
Browse files Browse the repository at this point in the history
Fixes #18257

Change-Id: Iafba5aa0a0641cfe36351bb0e4b57f20257fdc4e
Reviewed-on: https://go-review.googlesource.com/34210
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
bradfitz committed Dec 9, 2016
1 parent 00efa44 commit 9ad47c4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/go1.8.html
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,22 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
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>
Expand Down

0 comments on commit 9ad47c4

Please sign in to comment.