1234567891011121314151617181920212223 |
- from django.shortcuts import render
- from rest_framework import generics, status
- from rest_framework.response import Response
- from rest_framework.views import APIView
- from myapp.models import MyRequest
- from myapp.serializers import RequestSerializer
- # Create your views here.
- class GetInfo(APIView):
- def get(self, request):
- data = {
- "message": "Hello World get"
- }
- return Response(data)
- def post(self, request):
- data = {
- "message": "Hello World post",
- "received": request.data
- }
- return Response(data)
|