在golang http.NewRequest中包含%2F

When I try and include a "/" by using %2F in http.NewRequest, it converts it back into "/" when it calls url.Parse(). Is there any way to prevent this? I tried converting the percent to %25, but it still doesn't work.

You can see it here: http://play.golang.org/p/YOnktREbbf

This is a flaw in the design of the Go standard library. It has been acknowledged (issue 3659), but they have decided not to fix it for backwards compatibility reasons.

Although it isn't fun, the best way is to build a URL using opaque. You can find documentation here.