List of Posts
This is the complete list of categories of posts written during Apr 2022. They have been ordered by the publish date, with the most recent first.
- Published: 12-Apr-2022In this tutorial we shall add a web api that allows us to get all the records of a table. Please do note, however, that such a query is never done in a real project - it is invariably qualified with some paramaters that return a lesser number of records.
- Published: 13-Apr-2022In the previous tutorial we learned how to write a web api that accepts no parameters. We executed it to return all the records of a table. In this tutorial we shall add another web api that accepts a parameter and returns data on the basis of that parameter.
- Published: 15-Apr-2022In this tutorial we shall add a web api of GET type that takes an ID as a parameter and returns a record for that parameter.
- Published: 16-Apr-2022Postman is a software that can be used to easily and conveniently run and execute web api. It can be installed as a desktop application. The software offers a lot of functionality, but we shall be using a small part of that - relevant to just our web api needs.
- Published: 18-Apr-2022A web api of the POST type is used to create a new record. For example, if we have to create a new record of a doctor, then we have to use a POST api to send the relevant fields for creating a record.
- Published: 19-Apr-2022An Http PUT request is used to update an existing record. For this, a client has to send the unique id of the record along with the entire updated record. Partial updates are not done with a PUT type of Web Api. Partial updates are, rather, supported by an HTTP PATCH request. But that is not the topic of this tutorial. Today we shall focus on the Http Put type of Web Api.
- Published: 23-Apr-2022An HTTP DELETE request is used for deleting a record. The Server sends a 200 OK response on successful deletion alongwith the item that was deleted. Alternatively, it can send 204 No Content if the deleted item is, or cannot be included in the response. Let us see the implementation in this tutorial!
- Published: 25-Apr-2022We have been working with a model class consisting of three properties - id, Name and Fees. All the three properties have participated and have been exposed in json communication through every Web Api that we have discussed and written in the past tutorials of this chapter. This is called over-posting. But what if there were a property such as an email address that we didn't want exposed? This tutorial presents a solution through the concept of a Data Transfer Object.
- Published: 25-Apr-2022If an API has to return a collection of records, and if we do not want entire objects transmitted, then we can use a Data Transfer Object to return a small subset of properties, just-the-required subset. For a primer on over-posting, please refer the previous tutorial "Over-Posting in WebApi and a Solution with Data Transfer Object".
- Published: 28-Apr-2022This tutorial explains how to modify a POST type of WebApi so that it doesn't over-post data. A POST WebApi receives a data object as a parameter, and then adds it to a database, and finally it returns an HTTP 201 Created response alongwith the json for the newly added object. We have already covered this in one of the previous tutorials and for a primer on over-posting, please refer a previous tutorial "Over-Posting in WebApi and a Solution with Data Transfer Object".
- Published: 29-Apr-2022This tutorial explains how a GET web api can be called from a C++ WinRT application. I have chosen WinRT type because it contains a lot many pre-written functions that simplify internet access and json parsing. I won't be able to explain the details of a WinRT setup, so I have already created a WinRT console application that connects to our web api, and then obtains a string from the application, and then parses the json contained in that string. The c++ project has been provided in the downloads attached to this course.