0
を見つけ、私はstatus=HTTP_404_NOT_FOUND
とレスポンスを返す:私は、ステータス `とレスポンスを返す= HTTP_404_NOT_FOUND`が、views.pyで201
class CloudServerCreateAPIView(CreateAPIView):
serializer_class = CloudServerCreateSerializer
permission_classes = []
queryset = CloudServer.objects.all()
def perform_create(self, serializer):
return Response(data="There is no data left.", status=HTTP_404_NOT_FOUND, exception=Exception())
serializer.save()
をしかし、私はAPIを要求したとき、私はHTTP 201 Created
、ない404
を取得します:
POST /api/user_productmanage/cloudserver/create/
HTTP 201 Created
Allow: POST, OPTIONS
Content-Type: application/json
Vary: Accept
{
"expiration_time": "2017-12-11T11:11:11+08:00",
"profile": "asdas",
"buytime": 1,
"availablearea": 2
}