jaxenter-showcase icon indicating copy to clipboard operation
jaxenter-showcase copied to clipboard

Curl returning empty

Open Navakanth009 opened this issue 7 years ago • 5 comments

When I run this command from curl i am getting empty response curl curl:password@localhost:8081/oauth/token\?grant_type=client_credentials

image

Am I missing anything?

Navakanth009 avatar Mar 26 '18 14:03 Navakanth009

Can you try to use a POST HTTP request?

 curl -XPOST curl:password@localhost:8081/oauth/token\?grant_type=client_credentials

FrontierPsychiatrist avatar Mar 26 '18 15:03 FrontierPsychiatrist

Same again image

Navakanth009 avatar Mar 27 '18 06:03 Navakanth009

Ok, then please add the -v flag to curl for verbose output, it might give us a hint for what is going wrong.

curl -v -XPOST curl:password@localhost:8081/oauth/token\?grant_type=client_credentials

FrontierPsychiatrist avatar Mar 28 '18 07:03 FrontierPsychiatrist

It is showing 400 Bad Request

image

Navakanth009 avatar Mar 28 '18 09:03 Navakanth009

Ok, I checked it and it worked for me. I think the problem is that we escaped the ? in the curl command because it's necessary in a bash, but since you're on Windows it's actually not needed. Meaning, please try

 curl curl:password@localhost:8081/oauth/token?grant_type=client_credentials\

FrontierPsychiatrist avatar Mar 28 '18 11:03 FrontierPsychiatrist