Sto postando alcuni dati JSON e aggiungendo un'intestazione Authorization
. Tuttavia, l'oggetto richiesta non ha la proprietà di autorizzazione corretta. HTTP_AUTHORIZATION
e headers
entrambi mostrano i dettagli di autorizzazione appropriati.Flask werkzeug request.authorization è nient'altro che intestazioni di autorizzazione presenti
{'authorization': None,
'cookies': {},
'environ': {'CONTENT_LENGTH': '81',
'CONTENT_TYPE': u'application/json',
'HTTP_AUTHORIZATION': 'testkey:',
'HTTP_CONTENT_LENGTH': '81',
'HTTP_CONTENT_TYPE': 'application/json',
'HTTP_HOST': 'test',
'PATH_INFO': '/v1/test',
'QUERY_STRING': '',
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': '',
'SERVER_NAME': 'test',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'flask._preserve_context': False,
'werkzeug.request': <Request 'http://test/v1/test' [POST]>,
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x10d5471e0>,
'wsgi.input': <_io.BytesIO object at 0x11074c410>,
'wsgi.multiprocess': False,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)},
'headers': EnvironHeaders([('Authorization', testkey:'), ('Host', u'test'), ('Content-Length', u'81'), ('Content-Type', u'application/json')]),
'shallow': False,
'url': u'http://test/v1/test',
'url_rule': <Rule '/v1/test' (POST, OPTIONS) -> testresource>,
'view_args': {}}
Si prega di aggiungere l'errore della console/visualizzazione web effettiva –
@Ondeckshooting - Nessun errore. Si prega di leggere la domanda. Il problema è che la proprietà di autorizzazione è Nessuno, ma le intestazioni corrette sono lì. –