net/http: avoid setting body when NoBody is set for js/wasm
net/http: avoid setting body when NoBody is set for js/wasm

When http.NoBody is set, it is equivalent to Body being zero bytes.
We therefore set the body only if it is of length greater than 0.

Manually verified with wasmbrowsertest.

Fixes #36339

Change-Id: I9c108c38f99409f72ea101819af572429505a8ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/237758
Run-TryBot: Agniva De Sarker <a5f0d8ec472f89aaf942c60f780953deb78cdfb5@gmail.com>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
Reviewed-by: Johan Brandhorst <8c98250619a5229afaab52d25e022b9e3e1d22a2@gmail.com>
Reviewed-by: Emmanuel Odeke <277f8eaa8c7dfbc55c17bf5e30561c1a9c45c569@gmail.com>

nawawi/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,golang/go,cloudflare/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,cloudflare/go,cloudflare/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,nawawi/go,CAFxX/go,cloudflare/go,CAFxX/go,cloudflare/go,CAFxX/go,golang/go,nawawi/go,nawawi/go,golang/go,golang/go,nawawi/go,golang/go,CAFxX/go