HomeНаука и техникаRelated VideosMore From: kudvenkat

Part 5 ASP NET Web API Content Negotiation

511 ratings | 196661 views
In this video we will discuss Content Negotiation in Web API. Text version of the video http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-content-negotiation.html Slides http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-content-negotiation_5.html Dot Net and SQL Server Tutorials https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All ASP.NET Web API Text Articles and Slides http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-tutorial-for-beginners.html
Html code for embedding videos on your blog
Text Comments (49)
Sivasai Sambela (2 years ago)
Nice video Kudvenkat. I got a clear picture .
kudvenkat (2 years ago)
Thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful. I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd If you need DVDs or to download all the videos for offline viewing please visit http://www.pragimtech.com/order.aspx Slides and Text Version of the videos can be found on my blog http://csharp-video-tutorials.blogspot.com Tips to effectively use my youtube channel. https://www.youtube.com/watch?v=y780MwhY70s If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel. http://www.youtube.com/subscription_center?add_user=kudvenkat If you like these videos, please click on the THUMBS UP button below the video. May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them. Good Luck Venkat
chetanlande (8 days ago)
Well explained Kudvenkat. Thank u
https://www.youtube.com/channel/UCoLaNGYPckEg-IS22uqjB4A Please like, comment and share. :)
Leo G. (1 month ago)
in Visual Studio 2017 use: using Newtonsoft.Json.Serialization; for the method CamelCasePropertyNamesContractResolver();
Ganesh N (2 months ago)
One small clarification [3.36 to 3.44] "Its going to pick the first formatter which happens to be the json formatter ". I think it's the xml formatter and not the json formatter!
lakshmimulkala (2 months ago)
In visual studio, where do we set the content-type and accept header ?
Nabin Dutta (2 months ago)
text version not opening.
Mohammed Almannai (3 months ago)
if " CamelCasePropertyNamesContractResolver " is not working just writ " using Newtonsoft.Json.Serialization; " on the top or your code.
sai kumar Kurapati (6 months ago)
Spr kudvenkat one rqst sir plz upload AZURE (queues, tables, blobs, web and worker role) plz
IthuNamma Karaikudi (7 months ago)
Great tutorial venkat
IthuNamma Karaikudi (7 months ago)
watch my channel im jo
SSK (7 months ago)
Why we are using fidder, why not we directly give request in browser??. (I am completely new to this, so plz).
Rupesh Kamble (3 months ago)
you can not send POST, delete request from web browser.
Kaushik Roy Chowdhury (3 months ago)
We are using fiddler here to test all the HTTP request verbs (PUT, POST, DELETE) and to see the response in detail. Without the fiddler and using your browser you can only test the GET and can't view all the details of the request/response. Hope it answers your query.
Beatrix Ducz (10 months ago)
requires using Newtonsoft.Json.Serialization; namespace
Kudvenkat is the best <3
Vaibhav Fatkal (1 year ago)
Very nice explanation.
Mohammad Obeid (1 year ago)
Great videos , and the best thing you did is adding some pictures to the text version of videos thank you so much .
Amit Kumar (1 year ago)
Awesome tutorial. i have little doubt. how i can return json data on controller level?
DNAunion (1 year ago)
I paid for a Udemy 'course' on ASP.NET Web API and wish I hadn't. His English was understandable if I put effort into every word, but that made trying to follow what he was saying hard. And on top of that, the several lectures I watched were not all that informative. I gave up and YouTube'd for videos, and came across your series. Your English is very good, and your content is excellent.
Riley (1 year ago)
As always, I love your videos and the hard work you do making them!
Samantha (1 year ago)
Awesome tutorials!
Nihaal G (1 year ago)
great tutorial ...😊
Jerome Holasca (1 year ago)
hi i'm new to api, when the client sent a GET request how will you tell in your controller what action it will use?
DNAunion (1 year ago)
This is done automatically, using convention instead of configuration. The convention is basically: whatever the HTTP verb is in the request, ASP.NET will automatically call the controller method with the same name. So if GET request is received, ASP.NET Web API will call the Get method on the controller. If a GET request is received and the URL has a single integer, then the controller's Get method that takes a single integer parameter is called.
Ahmet Yaman (1 year ago)
thank you sir
George Sapp (1 year ago)
This was very helpful. I am a BA and this really content negotiation and provided me with a visual so that I could differentiate b/w XML & JSON formats.
Rupesh Kamble (3 months ago)
add this to webAPIconfig.cs : GlobalConfiguration.Configuration.Formatters.JsonFormatter.MediaTypeMappings .Add(new System.Net.Http.Formatting.RequestHeaderMapping("Accept", "text/html", StringComparison.InvariantCultureIgnoreCase, true, "application/json"));
Amar Dhanoa (1 year ago)
Great Tutorial, keep helping..
nishant singh (2 years ago)
Nice Explaination. I have one Question: What if i have 2 controllers and I want to return JSON from first and XML from another controller, then how to achieve this?
Kaushik Roy Chowdhury (3 months ago)
You have to issue two different requests to the fiddler corresponding to the routing of the two controllers. You then have to configure Accept-Headers accordingly.
Himanshu Goyal (2 years ago)
Nice one! There a typo in the first line on the slide- Accetpt
Abid Ali (2 years ago)
What is quality factor?
Abid Ali (2 years ago)
Thinh Vu, hahahaha very nice and enjoyable explanation. you are great man thanks. if I want an apple then I can sent a request also like banana, apple and i will receive apple.
Eww Eww (2 years ago)
For all kind of content type, quality factor i's just a real value between 0 and 1. E.x: I have an apple and banana. I will give you one. You like both of them but you can choose one in this case. So if you want to choose apple, you send me request like that: apple; q=0.5, banana;q=0.4  (or 0.45, etc.. q < 0.5 is accepted). So i will give you an apple depend on your request.
Abid Ali (2 years ago)
Thinh Vu, very thanks for replying. could you please explain what is the meaning of json quality factor? what kind of quality we are talking about?
Eww Eww (2 years ago)
You can think it is a priority for return data. If q factor of json data type greater than q factor of xml then json will be return if user does not provide specify Accept header.
achu achuss (2 years ago)
Thank you Sir !!!!
Kali Gold (2 years ago)
Make sure to use Nu Get to install JSON and also add "using Newtonsoft.Json.Serialization;" to WebApiConfig.cs. If you dont, CamelCaseProperty... will not work
kalyan soma (1 year ago)
thank you
Kashif Fayyaz (2 years ago)
I have no words to admire your effort
Vijay Anandh Sadagopan (2 years ago)
Can you post an Web APi with OAuth ?
thanks from Bangladesh
Arnab Chakraborty (2 years ago)
>>>> Sir Can u upload that Video.. DATATABBLES EDITOR with DOT NET WEB API... >>>> How to editing in Datatables in Datatable Editor in different manner >>>> Please Upload This video sir... This will more help for me... Thanks sir in advance...
Muhammad Aamir (2 years ago)
Awesome, highly appreciated.
Peter L (2 years ago)
very good tutorial thank you
Muhammad Rehbar Sheikh (2 years ago)
Thank you venkat sir. Great explanation.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.