How to get the link text from for.Request GOLANG Gorilla?

Want , the transition of the two different links handled by the same handler, but different. Displayed link text, for example:
Clicked on the link "LINK1" - the screen text says "LINK1"
Passed by reference "ссылка2" - the screen text says "ссылка2"
Therefore, the question of whether of for.Request to get the link text? Or, if not, then how to do it? Yuzayu GorilaMux
April 19th 20 at 11:59
1 answer
April 19th 20 at 12:01
request.URL
@Xzavieris the URL, and I need the link text. For example,
<a href = "/home">Home</a>
I need to get the word House - kristofer_Turcot commented on April 19th 20 at 12:04
@kristofer_Turcot, on the server side this is not possible if the text forms not server.
You can send text in the body of the request. - kaylie.Nitzsche commented on April 19th 20 at 12:07
@kaylie.Nitzsche , can you please give an example? - kristofer_Turcot commented on April 19th 20 at 12:10
@kristofer_Turcot, it is possible to put in the url, like so
<a href = "/home?Text=Home">Home</a>
And get
url := request.URL
querry := url.Query()
text := query.Get("Text")
- Xzavier commented on April 19th 20 at 12:13
@Xzavier, thank you - kristofer_Turcot commented on April 19th 20 at 12:16

Find more questions by tags Go