# Unsupported Media Type from C# JSOn serialized webApi (body set to raw JSON)

**URL:** <https://community.postman.com/t/unsupported-media-type-from-c-json-serialized-webapi-body-set-to-raw-json/38341>\
**Category:** Help Hub\
**Created:** [August 19, 2022, 9:29am UTC](https://community.postman.com/t/unsupported-media-type-from-c-json-serialized-webapi-body-set-to-raw-json/38341 "2022-08-19T09:29:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemenslinders](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@clemenslinders](https://community.postman.com/u/clemenslinders)\
**Post date:** [August 19, 2022, 9:29am UTC](https://community.postman.com/t/unsupported-media-type-from-c-json-serialized-webapi-body-set-to-raw-json/38341/1 "2022-08-19T09:29:43Z")

</div>

In Visual Studio C# I created a web API.  
When I test my web API in C# I put a POST: [https://localhost:7233/api/ShopFloor](https://localhost:7233/api/ShopFloor)

C# returns a JSON dataset.

In Postman I get the error:  
{  
“type”: “[RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content](https://tools.ietf.org/html/rfc7231#section-6.5.13)”,  
“title”: “Unsupported Media Type”,  
“status”: 415,  
“traceId”: “00-b75081b28d37a203ab203a8053fad13f-c78a2fb150d3ecff-00”  
}

When I search for this error I found that in Postman I needed to set the body to RAW and select JSON. Which I did.

But I still get this error.

What do I need to do so that I can see the returned dataset in Postman?

If I perform a GET than this is no problem, this functions OK.  
If I perform a PUT, than I have the same problem.

Kind regards,

Clemens Linders

---

<div class="post-metadata">

**Author:** ![mhers](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@mhers](https://community.postman.com/u/mhers)\
**Post date:** [August 19, 2022, 9:42am UTC](https://community.postman.com/t/unsupported-media-type-from-c-json-serialized-webapi-body-set-to-raw-json/38341/2 "2022-08-19T09:42:55Z")

</div>

Try to use header content-type: application/json

---

<div class="post-metadata">

**Author:** ![clemenslinders](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@clemenslinders](https://community.postman.com/u/clemenslinders)\
**Post date:** [August 19, 2022, 10:03am UTC](https://community.postman.com/t/unsupported-media-type-from-c-json-serialized-webapi-body-set-to-raw-json/38341/3 "2022-08-19T10:03:00Z")

</div>

Hi mhers,

In headers I created an extra key:  
Key: Content-type  
Value: application/json

I now get the following error:

{  
“type”: “[RFC 7231: Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content](https://tools.ietf.org/html/rfc7231#section-6.5.1)”,  
“title”: “One or more validation errors occurred.”,  
“status”: 400,  
“traceId”: “00-59776bed9e8c11712c242fe599b418c6-75cd2c7d1909830a-00”,  
“errors”: {  
“”: [  
“A non-empty request body is required.”  
],  
“sfData”: [  
“The sfData field is required.”  
]  
}  
}
