techdev-solutions / jaxenter-showcase

42 stars 32 forks source link

Curl returning empty #8

Open Navakanth009 opened 6 years ago

Navakanth009 commented 6 years ago

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?

FrontierPsychiatrist commented 6 years ago

Can you try to use a POST HTTP request?

 curl -XPOST curl:password@localhost:8081/oauth/token\?grant_type=client_credentials
Navakanth009 commented 6 years ago

Same again image

FrontierPsychiatrist commented 6 years ago

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
Navakanth009 commented 6 years ago

It is showing 400 Bad Request

image

FrontierPsychiatrist commented 6 years ago

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\