Hello and welcome to the Golang programming language course in the pit of your station.
We could define select all students method for rest player, and now we want to implement another function
that is supposed to insert a student in the student table of person database.
So define the function named like save as student dysfunction.
Accept two parameters first and object from issue type response writer and second, the pointer of a
steep request.
So we try find.
Save the student and set two parameters.
First, a parameter response writer response.
By the time TTP, the arts response writer and second request from Pointer Poynter Institute art request.
Now we want to implement a body of dysfunction.
This violation is supposed to save a new student and database.
So we should convert the data we received from the end point into a student object and save it in the
database.
To do this, we do the following first, create an object of a student model so defining variable like
the student from modern a student.
Therefore, we received the data sent from the client to the body in the request by the new decoder
function from Jason Typekit and saw it into a student object.
This function returns a new decoder that reads from reader.
So first, define an error variable as return time, roll call and equals and calling new decoder function.
Jason Start new decoder function and set body of request as argument request, dot body as argument
and calling decode function thought decode and Esaw to receive data into a student model and person
a student.
Now, check Iran's status, so right, if there are.
Not equals, Neal.
For example, if at all,
and set an interim status in response, Heather and displayed for a client by the FBI to function saw
the right response.
That's right, Heather
and select an overall status as argument from the SDP package.
For example, HTP thought a status internal seller of the status.
Internal server error and displayed for client by colleague F.A. Dot F printer function, Sid responds
as first argument Sid misses, for example, could not add new students
by
error calling personally and set error variable that.
And set the return value return
now connect to the database, then call the courier to save and the students, so we write DV tools.
And colleagues say function.
And sit a student as argument for dysfunction students, the format, the code and save the project.
Now we were able to implement the same function that at a new student into the database based data receiving
from client various API in order not to prolong the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.