I am have some problems passing in the correct headers for my graphql endpoints
The use case in Postman:
- call requestToken endpoint to obtain sessionToken value
- requestToken response contains Key Value " and Token Value.
- For subsequent calls, I set postman headers as: Key = X_SESSION_TOKEN Value = Token Value
The user case in Karate
1st feature 'requestToken.feature' successfully calls and stores key + tokenValue
2nd feature successfully defines and prints the token value here is my 2nd request:
Feature: version
Background: * url 'http://api-dev.markq.com:5000/' * def myFeature = call read('requestToken.feature') * def authToken = myFeature.sessionToken * configure headers = { 'X_SESSION_TOKEN': authToken , 'Content-Type': 'application/json' } Scenario: get version Given path 'query' Given text query = """ query { version } """ And request { query: '#(query)' } When method POST Then status 200 And print authToken And print response
I am not sure I send the headers right. Its coming back 200, but I keep getting a error 'token malformed' in the response message
Any suggestions? New at this, thanks!