C
C#3w ago
hosterip

✅ API can't serialize guid in an object from HttpClient request

The issue can be seen in attached pictures
No description
No description
No description
16 Replies
hosterip
hosteripOP3w ago
Nevermind, found solution
Thalnos
Thalnos3w ago
what was it?
hosterip
hosteripOP3w ago
for some reason request’s content type should have been specified with an attribute fromBody i’m sure it should have been like that by default, but anyway
Thalnos
Thalnos3w ago
yea usually is that by default on Post endpoinits, but I guess not when there is multiple params maybe. It wouldn't know what exactly to deserialize from the body if not explicitely specified
hosterip
hosteripOP3w ago
well, in other projects it works well and a request from swagger for example, works fine for this specific endpoint it's just that it doesn't work if I send a request from httpClient
Thalnos
Thalnos3w ago
Mhm no idea why then
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
hosterip
hosteripOP3w ago
I see the reason why, and it wasnt httpClient for some reason aspnet decided to treat that request as fromQuery and I didn't saw the request link in swagger at first
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
hosterip
hosteripOP2w ago
just a cropped image
hosterip
hosteripOP2w ago
No description
hosterip
hosteripOP2w ago
it was like that all along
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
hosterip
hosteripOP2w ago
there is no get endpoints for that url
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?