fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

Response Context #126

Open chrisaige opened 5 years ago

chrisaige commented 5 years ago

I think it would be a nice feature tobe able to read the response context. Currently the libary only parses the response body as far as im aware and there is no way to obtain information from the Response Headers and Cookies and so on.

Im imagining something like this (I am not a delphi developer):

var
  vList : TList<TPerson>;
  context : ResponseContext = ResponseContext.Create(); //Empty Instance
begin
  vList := RestClient.Resource('http://localhost:8080/java-rest-server/rest/persons')
                     .Accept(RestUtils.MediaType_Json)
                     .fill(context) //set a reference to the context that should be filled
                     .Get<TList<TPerson>>();