support raw messages on apiclient->apiserver
This commit is contained in:
@@ -100,7 +100,17 @@ public class ApiClient(string apiUrl) : IApiClient
|
||||
|
||||
Log.Debug("Create content");
|
||||
|
||||
if (context.Message is not null)
|
||||
if (context.Message is ApiRawByteMessage messageRawBytes)
|
||||
{
|
||||
content = new ByteArrayContent(messageRawBytes.Data);
|
||||
content.Headers.ContentType = new("application/octet-stream");
|
||||
}
|
||||
else if (context.Message is ApiRawStreamMessage messageRawStream)
|
||||
{
|
||||
content = new StreamContent(messageRawStream.Data);
|
||||
content.Headers.ContentType = new("application/octet-stream");
|
||||
}
|
||||
else if (context.Message is not null)
|
||||
content = new StringContent(context.Serializer.Serialize(context.Message)!, null, "application/json");
|
||||
else
|
||||
content = new StringContent(string.Empty, null, "application/json");
|
||||
|
||||
Reference in New Issue
Block a user