Closed pritam1919 closed 4 years ago
closing and you cross-posted to stack overflow
Sir , as there is no information to be found , I had to post it to stack overflow. And what is invalid about this question.
@pritam1919 will reopen if you follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
I'm new to GraphQL ,and I'm trying to automate a feature which uploads an xlsx file. For automation I'm using Karate, my Karate feature file steps are given below:
header Content-Type = 'multipart/form-data'
header x-Token = token
multipart file file = { read: '/Spend/data.xlsx', filename: 'data.xlsx', contentType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }
multipart field map = {file : ["variables.input.file"]}
def query = read('queries/createImportJob.graphql')
def operation = 'CreateImportJob'
def variables = {"input":{"category": 'SPEND' }}
request { query: '#(query)' , variables: '#(variables)', operation: '#(operation)'}
url url
method post
print response
status 200
Right now I'm getting the response as 500. Please suggest me the correct way to pass the multipart data into grapghql request.