django rest framwork on post not intended QueryDict

Viewed 257

I am using Django rest framework on an IIS 7.5 server 2008 R2 Enterprise and it is not clear for me why the:

request.data

return the following:

    {
    "_content_type": "application/json",
    "_content": "{\r\n    \"source_name\": \"None\",\r\n    \"dest_name\": \"reza\",\r\n    \"source_num\": \"12\",\r\n    \"dest_num\": \"15\",\r\n    \"amount\": 500\r\n}"
}

in response to the following post:

{
"source_name": "None",
"dest_name": "reza",
"source_num": "12",
"dest_num": "15",
"amount": 500
}

while, as i know, it should be a QueryDict with only the body information, not a QueryDict with a key: value '_content': with the type of unicode. It should be noted that i get the proper results in local and i have seen the following: https://github.com/encode/django-rest-framework/issues/3623

In response to the below commands i provided the following config file: https://drive.google.com/file/d/1mJbqU_i_h9P24OYhaAShssOoZcQFmqxO/view?usp=sharing

and the meta:

{
    "HTTP_CACHE_CONTROL": "max-age=0",
    "HTTP_CONNECTION": "keep-alive",
    "HTTP_CONTENT_LENGTH": "264",
    "HTTP_CONTENT_TYPE": "application/x-www-form-urlencoded",
    "HTTP_ACCEPT": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
    "HTTP_ACCEPT_ENCODING": "gzip, deflate",
    "HTTP_ACCEPT_LANGUAGE": "en-US,en;q=0.9,fa;q=0.8",
    "HTTP_COOKIE": "csrftoken=FVR9ajhAw5LBh59EXFMTT3GAO471E6WcLj0oKTWkLpDZGJU8HIYGE60DvedC4TIQ",
    "HTTP_HOST": "176.9.195.146:6400",
    "HTTP_REFERER": "http://176.9.195.146:6400/api/v1/posts/",
    "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36",
    "HTTP_ORIGIN": "http://176.9.195.146:6400",
    "HTTP_UPGRADE_INSECURE_REQUESTS": "1",
    "HTTP_DNT": "1",
    "IIS_UrlRewriteModule": "7,1,1993,2351",
    "APP_POOL_ID": "DefaultAppPool",
    "APP_POOL_CONFIG": "C:\\inetpub\\temp\\apppools\\DefaultAppPool\\DefaultAppPool.config",
    "APPL_MD_PATH": "/LM/W3SVC/1/ROOT",
    "APPL_PHYSICAL_PATH": "C:\\inetpub\\wwwroot\\",
    "AUTH_TYPE": "",
    "AUTH_PASSWORD": "",
    "AUTH_USER": "",
    "CERT_COOKIE": "",
    "CERT_FLAGS": "",
    "CERT_ISSUER": "",
    "CERT_SERIALNUMBER": "",
    "CERT_SUBJECT": "",
    "CONTENT_LENGTH": "264",
    "CONTENT_TYPE": "application/x-www-form-urlencoded",
    "DOCUMENT_ROOT": "C:\\inetpub\\wwwroot",
    "GATEWAY_INTERFACE": "CGI/1.1",
    "HTTPS": "off",
    "HTTPS_KEYSIZE": "",
    "HTTPS_SECRETKEYSIZE": "",
    "HTTPS_SERVER_ISSUER": "",
    "HTTPS_SERVER_SUBJECT": "",
    "INSTANCE_ID": "1",
    "INSTANCE_NAME": "DEFAULT WEB SITE",
    "INSTANCE_META_PATH": "/LM/W3SVC/1",
    "LOCAL_ADDR": "176.9.195.146",
    "LOGON_USER": "",
    "wsgi.path_info": "/api/v1/posts/",
    "PATH_INFO": "/api/v1/posts/",
    "PATH_TRANSLATED": "C:\\inetpub\\wwwroot\\api\\v1\\posts\\",
    "wsgi.query_string": "",
    "QUERY_STRING": "",
    "REMOTE_ADDR": "46.209.221.44",
    "REMOTE_HOST": "46.209.221.44",
    "REMOTE_PORT": "57716",
    "REMOTE_USER": "",
    "REQUEST_METHOD": "POST",
    "REQUEST_URI": "/api/v1/posts/",
    "SCRIPT_FILENAME": "C:\\inetpub\\wwwroot\\api\\v1\\posts\\",
    "wsgi.script_name": "",
    "SCRIPT_NAME": "",
    "SERVER_NAME": "176.9.195.146",
    "SERVER_PORT": "6400",
    "SERVER_PORT_SECURE": "0",
    "SERVER_PROTOCOL": "HTTP/1.1",
    "SERVER_SOFTWARE": "Microsoft-IIS/7.5",
    "URL": "/api/v1/posts/",
    "wsgi.input": [],
    "wsgi.errors": [],
    "wsgi.version": [
        1,
        0
    ],
    "wsgi.url_scheme": "http",
    "wsgi.multiprocess": true,
    "wsgi.multithread": false,
    "wsgi.run_once": false,
    "CSRF_COOKIE": "FVR9ajhAw5LBh59EXFMTT3GAO471E6WcLj0oKTWkLpDZGJU8HIYGE60DvedC4TIQ"
}
0 Answers
Related