Help getting URL
Answered
Sirex woodwasp posted this in #help-forum
Sirex woodwaspOP
Hello,
I would like some help/example on how I can get the URL that the user is on via the server component.
I would like some help/example on how I can get the URL that the user is on via the server component.
Answered by European sprat
7 Replies
Sirex woodwaspOP
I really need an option so I can make customized API requests
European sprat
you can try looking in
headers() but you might need to add a custom header with the path via middleware if there isn't already a header with the pathSirex woodwaspOP
Do you have an example how the headers work exactly? I tried using NextRequest but failed to do so.
Answer
Sirex woodwaspOP
omg i got it!
You can just get it from "params" in the generate Metadata!
So happy :D
Thanks anyway :3
Thanks anyway :3