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
When I attempt to run tests with this client, I run into a few snags.
/* As part of a [Test] method */varresponse=await _api.GetDoc();
Assert.That(response.IsSuccessStatusCode);/* This fails, even though the endpoint is working exactly as expected */
Assert.That(response.Error, Is.Null);
I can execute the request, but Refit (by default) tries to deserialize the response into JSON, which of course does not work.
Refit Error: System.Text.Json.JsonException
'test' is an invalid JSON literal. Expected the literal 'true'. Path: $ | LineNumber: 0 | BytePositionInLine: 1.
Of course, I came across this older issue, but I wanted to see if this was still up to date.
What are the recommendations for telling Refit that the response body should not be parsed as JSON?
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
-
I have a few endpoints that return
byte[]
, and I was wondering about best practices for working with those.Let's say I have some interface:
When I attempt to run tests with this client, I run into a few snags.
I can execute the request, but Refit (by default) tries to deserialize the response into JSON, which of course does not work.
Of course, I came across this older issue, but I wanted to see if this was still up to date.
What are the recommendations for telling Refit that the response body should not be parsed as JSON?
Beta Was this translation helpful? Give feedback.
All reactions