REST Intro – Build a REST Service in C# Visual Studio 2015 Part 1




About this tutorial:

Video duration: 9:34
A quick intro to REST and building a simple REST service using Visual Studio. Note – this will work in Visual Studio 2017 as well.

Post Author: OfficeTutes.com

Apple lover, ICT and LEAN consultant, MS Office lecturer My other website with video tutorials - Tutorials, guides and news for iPhones and iPads

36 thoughts on “REST Intro – Build a REST Service in C# Visual Studio 2015 Part 1

    Philippe Desrochers

    (October 21, 2018 - 1:48 pm)

    Hello Jon, is it possible to post the projets on github ? (otherwise do you give me the permission to do it?)

    ssinfod

    (October 21, 2018 - 1:48 pm)

    Hello Jon, very nice tutorial! Can I download the source code from somewhere?

    Cooper Tichenor

    (October 21, 2018 - 1:48 pm)

    Getting a 403.14 error after running?

    Pure Science

    (October 21, 2018 - 1:48 pm)

    Thank you for this tutorial. Very clear and simple.

    roul3688

    (October 21, 2018 - 1:48 pm)

    Thank you, thank you, thank you…

    Sakthi vel

    (October 21, 2018 - 1:48 pm)

    This is the most elegant video on the shortest time ! Great work !

    Dean Delicata

    (October 21, 2018 - 1:48 pm)

    Thanks Jon, this was really helpful. 🙂

    KUMARESH A

    (October 21, 2018 - 1:48 pm)

    Hi Jon, I am getting "Connection must be real and open". Can u please help me how to fix the issue. I used your part 4 in connection to MySQL.

    Hartej Dhiman

    (October 21, 2018 - 1:48 pm)

    Fantastic and simple. Wonderful job explaining REST API using .NET.

    Osamah Islam

    (October 21, 2018 - 1:48 pm)

    thanks jon, if only all videos were that easy

    Leonard Pera

    (October 21, 2018 - 1:48 pm)

    Hello, can this be done with VS 2012?

    Rishabh Singh

    (October 21, 2018 - 1:48 pm)

    I tried to run the controller as it is, and whenever I try making a request it returns the following 404 error
    {
    "Message": "No HTTP resource was found that matches the request URI 'http://localhost:11892/Api/User/'.",
    "MessageDetail": "No type was found that matches the controller named 'User'."
    }

    Strixnet - Dj Saitto

    (October 21, 2018 - 1:48 pm)

    Could you do a new video where you show us how to add a second controller? Expanding the API server 🙂

    FrozenEternity

    (October 21, 2018 - 1:48 pm)

    I really do hope you will be able to answer this question for me. To deploy this type of project on a Windows server will I need to install ASP.NET MVC on that server? I have VS Express on there and when I deploy the project to IIS it places the files but the site doesn't work with the API.

    Adrián Pérez

    (October 21, 2018 - 1:48 pm)

    Thanks A LOT Jon, I spent days searching, really digging the web, trying to find a clear, concise well explained and complete tutorial to really understand the whole thing. Many thanks for your effort, time and giveness. You really pointed me in the right direction. Thanks!

    Rajib Ghosal

    (October 21, 2018 - 1:48 pm)

    I have been looking for a quick overview and your videos are just the right ones. Tanks for taking the time to create these. Awesome!

    Ronald Nelson

    (October 21, 2018 - 1:48 pm)

    Thanks! This really made my project go much faster.

    Michael Gall

    (October 21, 2018 - 1:48 pm)

    Can you please provide a LINK to the source code once it is available?  Thanks.

    Michael Gall

    (October 21, 2018 - 1:48 pm)

    Great video series (much appreciated)!  Where can I download a copy of the source code (so I don't have to type it all in from scratch)?  Thanks.

    Arthur Dias Caldeira

    (October 21, 2018 - 1:48 pm)

    Thanks Jon Jensen!

    It will work fine to what I want.

    bizarreworld2002

    (October 21, 2018 - 1:48 pm)

    Hi Jon, excellent tutorial! Can we download the source code from somewhere?

    PrfMoriarty

    (October 21, 2018 - 1:48 pm)

    Clear, concise, and it works. Thanks!

    Rubens Guifarro

    (October 21, 2018 - 1:48 pm)

    Hi Jon!
    I have my web service running after following your videos. Around 6:16 you mentioned some mapping codes not to be covered here. I need information about that, since I'm trying to change my web service so all the methods are POST for all CRUD. Than way, I can send all of my parameters in the body of the POST and not the URL. Besides, that way I would have better ways to call the methods like: getAllPersons, getPerson, and such. What's your advice on mappings?

    Michael Gorgone

    (October 21, 2018 - 1:48 pm)

    Hi Jon, thanks for the great tutorial I'm having a "404" issue though that maybe you can guide me in the right direction to fix it. I'm using VS 2015 Community. I set up the Solution like you mentioned and got that "HTTP Error 403.14 – Forbidden" error. I added a "default.html" page and set it as the startup page and running in Debug mode brought that page up w/o any problem.

    However when I updated the URL to the WS URL… "/api/<mywsname>" I got a "404" error (same error in the Restlet client).

    Any thoughts as to what might be going on? From what I can tell I have everything setup the same way your tutorial has instructed me to.

    Thanks in advance for your help!

    Mike

    Carlos Tijerina

    (October 21, 2018 - 1:48 pm)

    Great tutorial and easy to understand.

    Cesar Gutierrez Olmos

    (October 21, 2018 - 1:48 pm)

    a mi me sale xml Soap y no REST???

    Victor Manuel Cruz Gaspar

    (October 21, 2018 - 1:48 pm)

    Que tal Jon. Te envió un cordial saludo y aprovecho para preguntarte si vas hacer algún curso sobre WCF. Gracias!!

    Haitai Ng

    (October 21, 2018 - 1:48 pm)

    @4:23 (Where you selected the ASP.NET Template) you selected "None", however you also added folders and core references form "Web API".If I created a MVC Application Template as opposed to "None", can I continue to follow this video as a tutorial?Is it possible to merge web mvc with web api?I never did web development until now, and I completed most of the front end of my. My current objective to determining how I obtain data from the servers then displaying it on my website.Thank you for your time!

    Xavier Showrn

    (October 21, 2018 - 1:48 pm)

    When i create a new api project, i can't add folders "web API". Do you know the reason? Thanks!!

    Wayne Green

    (October 21, 2018 - 1:48 pm)

    A very solid teaching performance. Easy to follow.

    Victor Manuel Cruz Gaspar

    (October 21, 2018 - 1:48 pm)

    Excelentes videos, Saludos desde México.

    Wernhs P

    (October 21, 2018 - 1:48 pm)

    Hi Jon. Would this work when handling file uploads? I've followed your iOS tutorial in consuming this web service and works perfect except now I need to add image upload to the form. I've tried using base64 conversion but it seems to crop the image when saving to the database. The base64 string seems to be truncated sql server.

    B Toz

    (October 21, 2018 - 1:48 pm)

    Great set of videos Jon! Nice and easy to follow, and straight to the point with real code examples. I enjoyed them all. Thank you for these.

    Evgeny Kleiman

    (October 21, 2018 - 1:48 pm)

    Could you explain how to publish and consume the REST service you had built in IIS? I tried to do this using Visual Studio and I succeeded topublish it. But i don't understand how consume it. In your sample that works under IIS Express you call localhost:<port>/api/person. When I publish the service in IIS I see many compiled files but I do not understand what address I should call to get the same result as you got in VS. Thank you

    Mandarino Maracuja

    (October 21, 2018 - 1:48 pm)

    Nice Tutorial. But I get a "301 Moved Permanently" instead of a "200 OK". The Port and everything in the URI seems to be right (of course for my localhost, in which the IIS Express is starting the application).
    If I find a solution, I will Post it here.

    Cliff Evans

    (October 21, 2018 - 1:48 pm)

    Jon – followed this exactly but on Debug, Start returns

    HTTP Error 403.14 – Forbidden
    The Web server is configured to not list the contents of this directory

Leave a Reply

Your email address will not be published. Required fields are marked *