I want to make very simple application in Python which:

When REST calls PUT/DEL/GET are recived than response code is 200
When REST call create is recived than response code is 201

I tried with sockets but I don't know how to send 201.
Use an existing web framework such as Flask or Django.  Doing this by yourself with sockets is way too much work, it's not worth it.
Recive REST and Response http codes in Python