Hi Frank,

Here is an example that should work for you, just change the localhost to
your host & the query to your query.

//
import groovyx.net.http.RESTClient

        def query =
'artifactory/api/search/artifact?name=assembly.bamba-5.10&repos=libs-snapshot-local'
        def server = new RESTClient()

        //preemptive authentication
        server.headers['Authorization'] = 'Basic
'+"admin:password".getBytes('iso-8859-1').encodeBase64()

       
server.parser.'application/vnd.org.jfrog.artifactory.search.ArtifactSearchResult+json'
= server.parser.'application/json'
        def resp = server.get(uri: "http://localhost:8081/$query";)
//

Hope that helps,
Shay.



--
View this message in context: 
http://forums.jfrog.org/Search-via-REST-API-causes-Bad-request-error-tp7578670p7578680.html
Sent from the Artifactory - Users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to