O'Reilly logo
  • MINSHENG, TSAI thinks this is interesting:

It’s interesting to note that you can’t extract the Fragment field out of a URL struct if you’re getting a request from the browser. Recall from chapter 1 that fragments are stripped by the browser before being sent to the server, so it’s not the Go libraries being annoying—it’s because the fragment you see on the browser never gets sent to the server. So why have it at all? It’s because not all requests come from browsers; you can get requests from HTTP client libraries or other tools, or even client frameworks like Angular. Also, Request isn’t used only at the server—it can also be used as part of the client library.


Cover of Go Web Programming


So, this means fragment will sent to server via apis but not via browser?