我尝试在此page之后使用Django-cors-headers指定标头。 (setting.py在底部)
之后,我使用Postman来检查我的设置是否确实应用于api。但是,我在allow中看不到post方法,也无法在哪里找到有关Access-Control-Allow-Origin,Access-Control-Allow-Headers的信息。
谁能告诉我如何在Postman中检查这些内容?
settings.py
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
#'social_django.middleware.SocialAuthExceptionMiddleware',
]
CORS_ORIGIN_ALLOW_ALL=True
CORS_ALLOW_METHODS=(
'OPTIONS',
'GET',
'POST',
'HEAD',
)
CORS_ALLOW_HEADERS=(
'x-requested-with',
)