1
@api_view(["POST"])
def Addition(x):
    number1=json.loads(x.body)
    addition=str(number1+6)

    return JsonResponse(" Addition is :"+addition+".",safe=False)

This is working code. Can any one please tell me how to add two inputs in body of postman for addition.

1 Answers1

0

First, A GET request shouldn't have a body HTTP GET with request body.

I don't think postman gives an option to pass body to a GET request. But you can pass parameter to a GET request. https://docs.djangoproject.com/en/2.1/ref/request-response/#django.http.HttpRequest.GET

ydrall
  • 338
  • 1
  • 3
  • 11