I have an MVC application with two micro services. In the first I call PostAsync()
method to send my custom object
public class Logo {
public Guid Id { get; set; }
public IEnumerable<byte> Content { get; set; }
}
to another service
public async Task PostLogo(Logo logo)
{
using (var client = new HttpClient())
{
await client.PostAsync(_url, new StringContent(JsonConvert.SerializeObject(logo), Encoding.UTF8, "application/json"));
}
}
In the second micro service I try to deserialize using
[HttpPost, Route("logo")]
public Task<FileUploadResultModel> SaveAsync([FromBody]Logo model)
{
return _fileService.SaveAsync(null);
}
but it gets null instead of input object
Can anyone explain how can I send/process custom object using Post request, please?