Get a specific header data from an API response

Options

Hi,

I am doing an api call to Shopify REST API.
This is returning all the headers:

I need specifically the "link" header, cause that's the link used for paging.

I've tried this (didn't work):



Any ideas on how to get this url?

Thanks!

Tagged:

Best Answer

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Answer ✓
    Options

    Headers are an array, so if want a specific one you need to know the index, which hopefully is always the same for the link.

    Then you either split by < and > to get only the link or use some other method to slice out what you want.

Answers