ApiStreamMessage
This commit is contained in:
@@ -66,8 +66,10 @@ public class ApiClient(string apiUrl) : IApiClient
|
||||
{
|
||||
if (mediaType == "application/json" && context.Serializer != null)
|
||||
result = context.Serializer.Deserialize(await context.HttpResponse.Content.ReadAsStringAsync(), typeof(TResponse)) as TResponse;
|
||||
else if (typeof(TResponse).IsAssignableTo(typeof(ApiRawMessage)) && mediaType == "application/octet-stream")
|
||||
result = (TResponse)(object)new ApiRawMessage(await context.HttpResponse.Content.ReadAsByteArrayAsync());
|
||||
else if (typeof(TResponse).IsAssignableTo(typeof(ApiRawByteMessage)) && mediaType == "application/octet-stream")
|
||||
result = (TResponse)(object)new ApiRawByteMessage(await context.HttpResponse.Content.ReadAsByteArrayAsync());
|
||||
else if (typeof(TResponse).IsAssignableTo(typeof(ApiRawStreamMessage)) && mediaType == "application/octet-stream")
|
||||
result = (TResponse)(object)new ApiRawStreamMessage(await context.HttpResponse.Content.ReadAsStreamAsync());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user