[Answered ]-DRF: Functional view not returning Response as expected

1👍

This is only what it prints when you print the message (call str(…) on it). The response contains the proper message.

If you for example work with the requests package, then you can obtain the JSON content with the .json() method [requests-doc]:

response = requests.post('www.some-domain.com/some/path/with/values')
print(response.json())

You can also access the response as binary content with the .content attribute [requests-doc]:

response = requests.post('www.some-domain.com/some/path/with/values')
print(response.content)

which will return a bytes object with the response, here thus a JSON blob.

Leave a comment