I've tried using ` curl -k -X POST -d "{"username"...
# kolide
a
I've tried using
curl -k -X POST -d "{"username": "test", "Password": "test"}" -H "Content-Type: application/json" <https://url/api/v1/kolide/login>
and also
curl -X POST -k --user "admin" -H "Content-Type: application/json" <https://url/api/v1/kolide/login>
c
Are you on Mac, Linux, or Windows?
If on Linux or Mac, use single quotes around the body (data) of the request:
Copy code
curl -k -X POST -d '{"username": "test", "Password": "test"}' -H "Content-Type: application/json"
If on windows, you have to manually escape all the inner double quote marks
a
I see.. Tried your example on Linux and it worked (was using Windows), Thanks!
Do you think you could also help me send a distributed query? I'm using the URLs as shown here https://github.com/kolide/fleet/blob/master/server/service/handler.go but I get a 'EOF' error as before.
The urls are
/api/v1/kolide/queries/run
and
/api/v1/kolide/queries/run_by_names
c
once you successfully authenticate, you get a
token
in the response
you have to send that bearer token with all the other requests in the
Authorization
header
so something like
curl -X POST <http://url/api/v1/kolide/queries/run> -H 'Content-Type: application/json' -H 'Authorization: Bearer <the token you got from the login response>' -d '{"body": "of the request"}'