HTTP request的返回值

 以下是我访问一个http://127.0.0.1:8020/test/拿到的request.META的值

{'ALLUSERSPROFILE': 'C:\\ProgramData',
 'ANDROID_SDK_HOME': 'C:\\Android', 
 'APPDATA': 'C:\\Users\\zhangcan\\AppData\\Roaming', 
 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 
 'COMMONPROGRAMFILES(X86)': 'C:\\Program Files (x86)\\Common Files',
 'COMMONPROGRAMW6432': 'C:\\Program Files\\Common Files', 
 'COMPUTERNAME': 'ZHANGCAN', 
 'COMSPEC': 'C:\\WINDOWS\\system32\\cmd.exe',  
 'CONFIGSETROOT': 'C:\\WINDOWS\\ConfigSetRoot',
 'DJANGO_SETTINGS_MODULE': 'luffy_test.settings',
 'FPS_BROWSER_APP_PROFILE_STRING': 'Internet Explorer',
 'FPS_BROWSER_USER_PROFILE_STRING': 'Default',
 'HOMEDRIVE': 'C:', 
 'HOMEPATH': '\\Users\\zhangcan', 
 'LOCALAPPDATA': 'C:\\Users\\zhangcan\\AppData\\Local', 
 'LOGONSERVER': '\\\\ZHANGCAN', 
 MOZ_PLUGIN_PATH': 'D:\\Program Files (x86)\\Foxit Software\\Foxit Reader\\plugins\\', 
 NUMBER_OF_PROCESSORS': '4',
 'ONEDRIVE': 'C:\\Users\\zhangcan\\OneDrive', 
 'OS': 'Windows_NT',
 'PATH': 'F:\\浠g爜搴揬铏氭嫙鐜\ue21a\ue568virtualenv\\ven_test\\Scripts;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;D:\\zhangmysql\\mysql-5.7.18-winx64\\mysql-5.7.18-winx64\\bin\\;d:\\Program Files (x86)\\PBB Reader\\x64\\;d:\\Program Files\\Git\\cmd;C:\\Android;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;D:\\Program Files\\nodejs\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\django\\bin;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\;C:\\Users\\zhangcan\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\zhangcan\\AppData\\Roaming\\npm;;F:\\代码库\\虚拟环境virtualenv\\ven_test\\Scripts', 
 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 
 'PROCESSOR_ARCHITECTURE': 'AMD64', 
 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 94 Stepping 3, GenuineIntel',
 'PROCESSOR_LEVEL': '6', 
 'PROCESSOR_REVISION': '5e03', 
 'PROGRAMDATA': 'C:\\ProgramData', 
 'PROGRAMFILES': 'C:\\Program Files', 
 'PROGRAMFILES(X86)': 'C:\\Program Files (x86)', 
 'PROGRAMW6432': 'C:\\Program Files', 
 'PROMPT': '(ven_test) $P$G', 
 'PSMODULEPATH': 'C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules', 
 'PUBLIC': 'C:\\Users\\Public', 
 'PYCHARM_HOSTED': '1', 
 'PYTHONIOENCODING': 'UTF-8', 
 'PYTHONPATH': 'F:\\代码库\\版本控制\\路飞学城\\课堂练习\\luffy_test', 
 'PYTHONUNBUFFERED': '1', 
 'SESSIONNAME': 'Console', 
 'SYSTEMDRIVE': 'C:', 
 'SYSTEMROOT': 'C:\\WINDOWS',
 'TEMP': 'C:\\Users\\zhangcan\\AppData\\Local\\Temp', 
 'TMP': 'C:\\Users\\zhangcan\\AppData\\Local\\Temp',
 'USERDOMAIN': 'ZHANGCAN', 
 'USERDOMAIN_ROAMINGPROFILE': 'ZHANGCAN',
 'USERNAME': 'zhangcan', 
 'USERPROFILE': 'C:\\Users\\zhangcan', 
 'VIRTUAL_ENV': 'F:\\浠g爜搴揬铏氭嫙鐜\ue21a\ue568virtualenv\\ven_test', 
 'VS140COMNTOOLS': 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\', 
 'WINDIR': 'C:\\WINDOWS', 
 '_OLD_VIRTUAL_PATH': 'C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;D:\\zhangmysql\\mysql-5.7.18-winx64\\mysql-5.7.18-winx64\\bin\\;d:\\Program Files (x86)\\PBB Reader\\x64\\;d:\\Program Files\\Git\\cmd;C:\\Android;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;D:\\Program Files\\nodejs\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\django\\bin;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\;C:\\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\;C:\\Users\\zhangcan\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\zhangcan\\AppData\\Roaming\\npm;', 
 '_OLD_VIRTUAL_PROMPT': '$P$G', 
 'RUN_MAIN': 'true',
 'SERVER_NAME': 'zhangcan', 
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'SERVER_PORT': '8020',
 'REMOTE_HOST': '', 
 'CONTENT_LENGTH': '', 
 'SCRIPT_NAME': '', 
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SOFTWARE': 'WSGIServer/0.2', 
 'REQUEST_METHOD': 'GET', 
 'PATH_INFO': '/test/',
 'QUERY_STRING': '', 
 'REMOTE_ADDR': '127.0.0.1', 
 'CONTENT_TYPE': 'text/plain', 
 'HTTP_HOST': '127.0.0.1:8020', 
 'HTTP_CONNECTION': 'keep-alive', 
 'HTTP_CACHE_CONTROL': 'max-age=0', 
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36', 
 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 
 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 
 'HTTP_ACCEPT_LANGUAGE': 'zh-CN,zh;q=0.9', 
 'HTTP_COOKIE': 'csrftoken=cQ34AgshOcf7Ge7CPoz4rgwW1mlh8HiBOw1Y6KdHmHk75plm2nd0oTRnGJSS4hkv',
 'wsgi.input': <_io.BufferedReader name=820>,
 'wsgi.errors': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>, 
 'wsgi.version': (1, 0), 
 'wsgi.run_once': False, 
 'wsgi.url_scheme': 'http', 
 'wsgi.multithread': True,
 'wsgi.multiprocess': False, 
 'wsgi.file_wrapper': <class 'wsgiref.util.FileWrapper'>,
 'CSRF_COOKIE': 'cQ34AgshOcf7Ge7CPoz4rgwW1mlh8HiBOw1Y6KdHmHk75plm2nd0oTRnGJSS4hkv'}

 

 

下面这个则是访问http://127.0.0.1:8020/test/%EF%BC%9Fk1=v1&k2=v2拿到的request.META的值

{
    'ALLUSERSPROFILE': 'C: \\ProgramData',
    'ANDROID_SDK_HOME': 'C: \\Android',
    'APPDATA': 'C: \\Users\\zhangcan\\AppData\\Roaming',
    'COMMONPROGRAMFILES': 'C: \\ProgramFiles\\CommonFiles',
    'COMMONPROGRAMFILES(X86)': 'C: \\ProgramFiles(x86)\\CommonFiles',
    'COMMONPROGRAMW6432': 'C: \\ProgramFiles\\CommonFiles',
    'COMPUTERNAME': 'ZHANGCAN',
    'COMSPEC': 'C: \\WINDOWS\\system32\\cmd.exe',
    'CONFIGSETROOT': 'C: \\WINDOWS\\ConfigSetRoot',
    'DJANGO_SETTINGS_MODULE': 'luffy_test.settings',
    'FPS_BROWSER_APP_PROFILE_STRING': 'InternetExplorer',
    'FPS_BROWSER_USER_PROFILE_STRING': 'Default',
    'HOMEDRIVE': 'C: ',
    'HOMEPATH': '\\Users\\zhangcan',
    'LOCALAPPDATA': 'C: \\Users\\zhangcan\\AppData\\Local',
    'LOGONSERVER': '\\\\ZHANGCAN',
    'MOZ_PLUGIN_PATH': 'D: \\ProgramFiles(x86)\\FoxitSoftware\\FoxitReader\\plugins\\',
    'NUMBER_OF_PROCESSORS': '4',
    'ONEDRIVE': 'C: \\Users\\zhangcan\\OneDrive',
    'OS': 'Windows_NT',
    'PATH': 'F: \\浠g爜搴揬铏氭嫙鐜\ue21a\ue568virtualenv\\ven_test\\Scripts;C: \\ProgramFiles(x86)\\Intel\\iCLSClient\\;C: \\ProgramFiles\\Intel\\iCLSClient\\;C: \\Windows\\system32;C: \\Windows;C: \\Windows\\System32\\Wbem;C: \\Windows\\System32\\WindowsPowerShell\\v1.0\\;C: \\ProgramFiles(x86)\\Intel\\Intel(R)ManagementEngineComponents\\DAL;C: \\ProgramFiles\\Intel\\Intel(R)ManagementEngineComponents\\DAL;C: \\ProgramFiles(x86)\\Intel\\Intel(R)ManagementEngineComponents\\IPT;C: \\ProgramFiles\\Intel\\Intel(R)ManagementEngineComponents\\IPT;C: \\ProgramFiles(x86)\\NVIDIACorporation\\PhysX\\Common;C: \\ProgramFiles\\Intel\\WiFi\\bin\\;C: \\ProgramFiles\\CommonFiles\\Intel\\WirelessCommon\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C: \\WINDOWS\\system32;C: \\WINDOWS;C: \\WINDOWS\\System32\\Wbem;C: \\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;D: \\zhangmysql\\mysql-5.7.18-winx64\\mysql-5.7.18-winx64\\bin\\;d: \\ProgramFiles(x86)\\PBBReader\\x64\\;d: \\ProgramFiles\\Git\\cmd;C: \\Android;C: \\ProgramFiles(x86)\\WindowsKits\\8.1\\WindowsPerformanceToolkit\\;D: \\ProgramFiles\\nodejs\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\django\\bin;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\;C: \\Users\\zhangcan\\AppData\\Local\\Microsoft\\WindowsApps;C: \\Users\\zhangcan\\AppData\\Roaming\\npm;;F: \\代码库\\虚拟环境virtualenv\\ven_test\\Scripts',
    'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC',
    'PROCESSOR_ARCHITECTURE': 'AMD64',
    'PROCESSOR_IDENTIFIER': 'Intel64Family6Model94Stepping3,    GenuineIntel',
    'PROCESSOR_LEVEL': '6',
    'PROCESSOR_REVISION': '5e03',
    'PROGRAMDATA': 'C: \\ProgramData',
    'PROGRAMFILES': 'C: \\ProgramFiles',
    'PROGRAMFILES(X86)': 'C: \\ProgramFiles(x86)',
    'PROGRAMW6432': 'C: \\ProgramFiles',
    'PROMPT': '(ven_test)$P$G',
    'PSMODULEPATH': 'C: \\ProgramFiles\\WindowsPowerShell\\Modules;C: \\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules',
    'PUBLIC': 'C: \\Users\\Public',
    'PYCHARM_HOSTED': '1',
    'PYTHONIOENCODING': 'UTF-8',
    'PYTHONPATH': 'F: \\代码库\\版本控制\\路飞学城\\课堂练习\\luffy_test',
    'PYTHONUNBUFFERED': '1',
    'SESSIONNAME': 'Console',
    'SYSTEMDRIVE': 'C: ',
    'SYSTEMROOT': 'C: \\WINDOWS',
    'TEMP': 'C: \\Users\\zhangcan\\AppData\\Local\\Temp',
    'TMP': 'C: \\Users\\zhangcan\\AppData\\Local\\Temp',
    'USERDOMAIN': 'ZHANGCAN',
    'USERDOMAIN_ROAMINGPROFILE': 'ZHANGCAN',
    'USERNAME': 'zhangcan',
    'USERPROFILE': 'C: \\Users\\zhangcan',
    'VIRTUAL_ENV': 'F: \\浠g爜搴揬铏氭嫙鐜\ue21a\ue568virtualenv\\ven_test',
    'VS140COMNTOOLS': 'C: \\ProgramFiles(x86)\\MicrosoftVisualStudio14.0\\Common7\\Tools\\',
    'WINDIR': 'C: \\WINDOWS',
    '_OLD_VIRTUAL_PATH': 'C: \\ProgramFiles(x86)\\Intel\\iCLSClient\\;C: \\ProgramFiles\\Intel\\iCLSClient\\;C: \\Windows\\system32;C: \\Windows;C: \\Windows\\System32\\Wbem;C: \\Windows\\System32\\WindowsPowerShell\\v1.0\\;C: \\ProgramFiles(x86)\\Intel\\Intel(R)ManagementEngineComponents\\DAL;C: \\ProgramFiles\\Intel\\Intel(R)ManagementEngineComponents\\DAL;C: \\ProgramFiles(x86)\\Intel\\Intel(R)ManagementEngineComponents\\IPT;C: \\ProgramFiles\\Intel\\Intel(R)ManagementEngineComponents\\IPT;C: \\ProgramFiles(x86)\\NVIDIACorporation\\PhysX\\Common;C: \\ProgramFiles\\Intel\\WiFi\\bin\\;C: \\ProgramFiles\\CommonFiles\\Intel\\WirelessCommon\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C: \\WINDOWS\\system32;C: \\WINDOWS;C: \\WINDOWS\\System32\\Wbem;C: \\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;D: \\zhangmysql\\mysql-5.7.18-winx64\\mysql-5.7.18-winx64\\bin\\;d: \\ProgramFiles(x86)\\PBBReader\\x64\\;d: \\ProgramFiles\\Git\\cmd;C: \\Android;C: \\ProgramFiles(x86)\\WindowsKits\\8.1\\WindowsPerformanceToolkit\\;D: \\ProgramFiles\\nodejs\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\django\\bin;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\;C: \\Users\\zhangcan\\AppData\\Local\\Programs\\Python\\Python36\\;C: \\Users\\zhangcan\\AppData\\Local\\Microsoft\\WindowsApps;C: \\Users\\zhangcan\\AppData\\Roaming\\npm;',
    '_OLD_VIRTUAL_PROMPT': '$P$G',
    'RUN_MAIN': 'true',
    'SERVER_NAME': 'zhangcan',
    'GATEWAY_INTERFACE': 'CGI/1.1',
    'SERVER_PORT': '8020',
    'REMOTE_HOST': '',
    'CONTENT_LENGTH': '',
    'SCRIPT_NAME': '',
    'SERVER_PROTOCOL': 'HTTP/1.1',
    'SERVER_SOFTWARE': 'WSGIServer/0.2',
    'REQUEST_METHOD': 'GET',
    'PATH_INFO': '/test/?k1=v1&k2=v2',
    'QUERY_STRING': '',
    'REMOTE_ADDR': '127.0.0.1',
    'CONTENT_TYPE': 'text/plain',
    'HTTP_HOST': '127.0.0.1: 8020',
  'HTTP_CONNECTION': 'keep-alive', 'HTTP_CACHE_CONTROL': 'max-age=0', 'HTTP_UPGRADE_INSECURE_REQUESTS': '1', 'HTTP_USER_AGENT': 'Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML, likeGecko)Chrome/62.0.3202.89Safari/537.36', 'HTTP_ACCEPT': 'text/html, application/xhtml+xml, application/xml;q=0.9, image/webp, image/apng, */*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br', 'HTTP_ACCEPT_LANGUAGE': 'zh-CN,zh;q=0.9', 'HTTP_COOKIE': 'csrftoken=cQ34AgshOcf7Ge7CPoz4rgwW1mlh8HiBOw1Y6KdHmHk75plm2nd0oTRnGJSS4hkv', 'wsgi.input': <_io.BufferedReadername=900>, 'wsgi.errors': <_io.TextIOWrappername='<stderr>'mode='w'encoding='UTF-8'>, 'wsgi.version': (1,0), 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.multithread': True, 'wsgi.multiprocess': False, 'wsgi.file_wrapper': <class'wsgiref.util.FileWrapper'>, 'CSRF_COOKIE': 'cQ34AgshOcf7Ge7CPoz4rgwW1mlh8HiBOw1Y6KdHmHk75plm2nd0oTRnGJSS4hkv' }

 

posted @ 2017-11-21 19:24  张璨  阅读(4790)  评论(0编辑  收藏  举报