Forum > Networking and Web Programming

[Solved] TFPHTTPClient read headers of response?

(1/1)

lainz:
Hi, according to this API I'm using, I need to do pagination to retrieve more than 30 items:
https://github.com/TiendaNube/api-docs?tab=readme-ov-file#pagination


--- Quote ---To check the next and previous links for pagination you can use the Link header:
--- End quote ---


--- Quote ---Link: <https://api.tiendanube.com/v1/123456/products?page=3&per_page=100>; rel="next",
  <https://api.tiendanube.com/v1/123456/products?page=50&per_page=100>; rel="last"
--- End quote ---

How I can read the headers of the response (if possible) with TFPHTTPClient?

Also how I can grab the url from that text, giving this example:


--- Quote ---Link: <https://api.tiendanube.com/v1/123456/products?page=3&per_page=100>; rel="next",
  <https://api.tiendanube.com/v1/123456/products?page=50&per_page=100>; rel="last"
--- End quote ---

I need to read 'next' url to pass it to the next batch of GET...

Edit: maybe with pos(<) then pos(>) of the first line and copy(...)

Thanks in advance

lainz:
Solved, there's a ResponseHeaders property..

Navigation

[0] Message Index

Go to full version