Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when i was using PUT method in postman through Basic Auth i got an error ,i was working on django rest-framework

Tags:

django

postman

{
      "detail":"Unsupported media type \"text/plain\" in request."
}

this image is from postman

like image 771
SHAYAK Avatar asked Oct 01 '19 15:10

SHAYAK


People also ask

How does Django REST framework authentication work?

Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with. The permission and throttling policies can then use those credentials to determine if the request should be permitted.

What is permission in Django REST framework?

Permissions are used to grant or deny access for different classes of users to different parts of the API. The simplest style of permission would be to allow access to any authenticated user, and deny access to any unauthenticated user. This corresponds to the IsAuthenticated class in REST framework.


1 Answers

Its occure because of content type of your request .

  1. 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”

like image 114
Hamed Rostami Avatar answered Sep 19 '22 08:09

Hamed Rostami