C
C#2y ago
Messiah

❔ Do I need a model to serialize a json async?

My http response message is a big random json that I just want to convert to a string. The JsonSerializer.SerializeAsync() requires me to pass a model as argument. I can't provide a model because I don't know what the response will be. I'm more curious about why a model is required than the solution honestly
9 Replies
canton7
canton72y ago
I'm confused. What objects are holding your data? What exactly is "a big random data"?
Messiah
MessiahOP2y ago
well the data is in a HttpResponseMessage
canton7
canton72y ago
And what does the HttpResponseMessage's content contain?
Messiah
MessiahOP2y ago
some json strings
canton7
canton72y ago
It can only contain 1 string
Messiah
MessiahOP2y ago
jesus, am I this stupid? I can just directly print the string from the request, no?
canton7
canton72y ago
That's kinda what I'm asking 😛
Messiah
MessiahOP2y ago
I forgot the data was inside httpresponseMessage thank you
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server