0

I'm performing the below CURL request in Postman, but it's not working.

curl --location 'http://gravity.freestylelibre.devops:81/graphql' \ --header 'Authorization: Bearer fkvb31wfm3xh64k415hldo5eba4qiu4s' \ --header 'store: 37' \ --header 'Content-Type: application/json' \ --header 'Cookie: PHPSESSID=rimu6j4naus2c67jstmsar1j4a; private_content_version=c5ffb5a3f0dae6c381024d34148823e0' \ --data-raw '{"query":"mutation {\r\n generateCustomerToken(\r\n email: \"[email protected]\"\r\n password: \"Nilkunj@123\"\r\n ) {\r\n token \r\n }\r\n}","variables":{}}' 

2 Answers 2

0

You don't need to pass these headers. I tried your request, but the server is returning a 502 Bad Gateway error. I added the code that should work.

--header 'Authorization: Bearer fkvb31wfm3xh64k415hldo5eba4qiu4s' --header 'store: 37' 

Sample code which work:

curl --location 'http://gravity.freestylelibre.devops:81/graphql' \ --header 'Content-Type: application/json' \ --data-raw '{"query":"mutation {\r\n generateCustomerToken(\r\n email: \"[email protected]\"\r\n password: \"Nilkunj@123\"\r\n ) {\r\n token\r\n }\r\n}\r\n","variables":{}}' 
0

Try with below CURL request.

curl --location -g 'http://gravity.freestylelibre.devops:81/graphql' \ --header 'Content-Type: application/json' \ --data '{"query":"mutation {\r\n generateCustomerToken(\r\n email: \"[email protected]\"\r\n password: \"Nilkunj@123\"\r\n ) {\r\n token \r\n }\r\n}","variables":{}}' 

Don't need to pass Authorization in the CURL request for the generate customer token.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.