jjw 0 Posted November 21, 2022 (edited) Hey Can someone help me please or point me in the right direction. im trying to figure out how i can get the response headers from the TSslHttpRest here is my scenario: I need to get multiple JSON files from a web API (Containing 2 parameters and 1 authentication header) *sslhttprest.RestParams.AddItem('page_number', inttostr(x)); *sslhttprest.RestParams.AddItem('page_size', inttostr(y)); & * sslhttprest.ExtraHeaders.Add('Authorization: xxxx'); Downloading the JSON file to Stream / File works fine. but i need the additional response header info, supplied by the 3rd party, as it contains additional basic info that i need to abide by (how many calls per minute i can make vs how many i already did) is this possible? Screenshot from Postman' Response below Thanks in advance JJ Edited November 21, 2022 by jjw Share this post Link to post
FPiette 380 Posted November 22, 2022 OnHeaderData should probably work for you. From the handler, access the LastResponse property to get the line. Share this post Link to post
Angus Robertson 572 Posted November 22, 2022 THttpCli and TSslHttpRest have a property RcvdHeader: TStrings which after a request completes has all the received headers, so just search it for your X headers. Angus 1 Share this post Link to post