ASP.NET Core Web API unsupported Media type

Hi I’m trying to build my first API wit Core and have been following this tutorial:

I’d like to find out why I’m unable to post anything to my database (which I have setup in previous steps)

I’m using songs instead of todo’s and when I try to make a POST request in postman I get this response

    "type": "",
    "title": "Unsupported Media Type",
    "status": 415,
    "traceId": "|25aa76f-4966fce03006b505."

It doesn’t matter what key:value pairs I send to my API, when using the post method I will always get the same response.

my Song class looks like this:

    public class Song
        public int Id { get; set; }

        public string Title { get; set; }

        public string Artist { get; set; }

        public DateTime ReleaseDate { get; set; }

        public string Spotify { get; set; }

        public string Youtube { get; set; }

        public string Instagram { get; set; }

This is the link to the exact step I’m at:

ps. I’m still very new when it comes to programming and it will probaly been something super obvious.


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

In the body request, you are sending an invalid JSON. you don’t set content type right in the header.

To solve it in the POSTMAN, click in Text and select the JSON option from the drop-down list. Then add the open and closed braces. So that you receive an HTTP 400 code. Send your object like the following snippet.


For detail information, click here

Method 2

Yes that was it, inside postman I had to change a header from text/plain to application/json!

thank you for your suggestion!

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x