I'm trying to send a header with a requests.get:
import requests
url = 'http://qp-nachorat2000:8018/icws/' + sessionID + '/status/user-statuses/Administrator'
header = {'ININ-ICWS-CSRF-Token': csrfToken}
pcRequest = requests.get(url, headers=header)
This results in a 400 response:
{u'errorCode': 2,
u'message': u'A session CSRF token is needed for this request, but none was provided.',
u'errorId': u'error.request.accessDenied.csrfToken.missing'}
The same GET works perfectly fine in Postman:
What am I missing? Any help would be appreciated.
This question is really old, but here's your answer for anyone looking.
When you make your original connection like this:
you will need to pass data from that json data that is returned into the header of the get request:
Essentially just take the json data that is returned from the original connection attempt, and using the
['Token']
key, pass that as the token in the header of theGET
.