Javascript Function to extract response header for link

Hi all,
Okta has a very unusual way to return next record set token.
Question here is not how it works. I know how the link response header values work. My question is has anyone written a logic to extract the next link header in JavaScript? I am learning React and need to get a leg up.

Okta returns either 1 or 2 response header named “link”. It returns 1 response header “link” if there is no next set of data. If there are more records then it will return 2 response header named “link”.

In my other programming language I wrote a function to handle this 1 or 2 link headers and return the next URL to call if there are more records. I am unsure as to how to write this in React JavaScript.

any help is appreciated.

Thank you and Take care

It might help if you post somewhere else (like SO under javascript tag). The question is not really Okta related, but rather how to handle HTTP req/res

1 Like