Any examples for accessing Guvnor server using cURL?
Try 1:
curl -i --user username:pwd -H"Content-Type: application/json" -X GET localhost:8080/guvnor-server/rest/packages
Returns:
HTTP/1.1 401 Unauthorized
Try 2:
curl -X GET -u"username:pwd" localhost:8080/guvnor-server/rest/packages.json
Returns:
HTTP/1.1 404 Not Found
Referring: docs.jboss.org/drools/release/5.5.0.CR1/drools-guvnor-docs/html/ch09 dot html
Thx!
This worked for me on Guvnor 5.5.0.Final under Tomcat 7
Using:
Returns:
Troubleshooting:
This error occurs because "resteasy no longer includes json support in the jars" according to this post by @sstarcher. What is not clear from that answer, was how to fix the problem in drools-guvnor.
In this case, using drools-guvnor.5.5.0.Final, you need to download two jar files:
You should place both jar files in your {TOMCAT_HOME}/webapps/drools-guvnor/WEB-INF/lib folder. which looks like this on some systems:
Next stop and restart the webserver. On Tomcat from the {TOMCAT_HOME}/bin directory you can use the ./shutdown.sh and ./startup.sh commands.
401 - Unauthorized. This occurs if you don't use the -u user:pass optional argument. Out of the box, guvnor uses a fake basic authenticator which requires headers to work.
404 -Not Found. This error will occur if you have not specified the correct name of the directory or resource in the request.
405 - Method Not allowed. Happens when you mangle the curl options, forget quotes, etc.
406 - Not Acceptable. This error will occur if you specified an unsupported 'Accept:' Header using the -H option for curl.
HTH