Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How can modify request.data in django REST framework

$
0
0

I am using Django REST Framework

request.data = '{"id": "10", "user": "tom"}'

I want to add extra attribute like "age": "30" before sending it to further like

    request.data = new_data    response = super().post(request, *args, **kwargs)

I have two issues

  1. Why request.data is coming as string rather than dict
  2. How can I update the request.data

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>