You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all, bit of a refit noob here... so some questions may seem trivial (apologies)
I can do something like
varclient=newHttpClient();// dirty example for brevityvarresponse=awaitclient.GetAsync("https://api.example.com",HttpCompletionOption.ResponseHeadersRead);awaitusingvarcontent=awaitresponse.Content.ReadAsStreamAsync();varresult=awaitJsonSerializer.DeserializeAsync<Foo>(content);
However, in Refit interface I cant set ResponseHeadersRead, what would be equivalent? What Im trying to achieve is to avoid waiting for whole content to be loaded into memory prior deserialisation (think this GetFoo is returning quite large data sets). Also, what would be the difference between these two different methods below? Which one is more performant (relatively speaking)?
Does Refit fetches all the item first then Deserialises ? Whats the underlying mechanics of the refit implementations? Does is uses GetStringAsyncGetStreamAsync or GetAsync ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all, bit of a refit noob here... so some questions may seem trivial (apologies)
I can do something like
However, in Refit interface I cant set
ResponseHeadersRead
, what would be equivalent? What Im trying to achieve is to avoid waiting for whole content to be loaded into memory prior deserialisation (think this GetFoo is returning quite large data sets). Also, what would be the difference between these two different methods below? Which one is more performant (relatively speaking)?Does Refit fetches all the item first then Deserialises ? Whats the underlying mechanics of the refit implementations? Does is uses
GetStringAsync
GetStreamAsync
orGetAsync
?Beta Was this translation helpful? Give feedback.
All reactions