Put content in HttpResponseMessage object?

后端 未结 8 1533
感情败类
感情败类 2020-11-28 03:31

Several months ago, Microsoft decided to change up the HttpResponseMessage class. Before, you could simply pass a data type into the constructor, and then return the message

8条回答
  •  盖世英雄少女心
    2020-11-28 03:47

    No doubt that you are correct Florin. I was working on this project, and found that this piece of code:

    product = await response.Content.ReadAsAsync();
    

    Could be replaced with:

    response.Content = new StringContent(string product);
    

提交回复
热议问题