I want to make a request in
Go to an API but the answers are paged so I have to go through them.
The pagination comes on the
header in the element
link , something like this:
<page=3>; rel="next",<page=1>; rel="prev";<page=5>; rel="last"
I was trying to solve it with regular expressions and with
Splits but in both cases I did not succeed.
The request I'm doing with the http library, like this:
resp, err := http.Get("http://example.com/")
Header.link I get it like this:
and the result is the string that I put above.
How do I get the last page? And the others?