23👍
✅
Its occure because of content type of your request .
- first check your views content type. 2.change content type according to view in postman .
For example :
Header -> add
key: “Content-Type”
value: “application/json”
- Google App Engine Application Extremely slow
- How to use normal Filter together with SearchFilter on Django Rest Framework?
- Django and Custom Form validation
- Django CMS malfunction: Site matching query does not exist
0👍
def do(method ='get', data={}, is_json =True):
headers = {}
if is_json:
headers['content-type'] ='application/json'
data = json.dumps(data)
r = requests.request(method, ENDPOINT, data=data, headers = headers )
print(r.text)
print(r.status_code)
return r
do(method='post', data={"content": "some cool api ", 'user':1})
- Save form data in Django
- Python: How can I override one module in a package with a modified version that lives outside the package?
- Default value for Django choices field
Source:stackexchange.com