Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:23:38+00:00 2026-05-29T13:23:38+00:00

Given this api documentation , how would I use HTTPBuilder and Groovy to construct

  • 0

Given this api documentation, how would I use HTTPBuilder and Groovy to construct my query? I’ve tried multiple things but I’m not getting it right.

def http = new HTTPBuilder()
http.request('http://artifactory:8888/libs-snapshot-local/my/jar/1.0/test-jar-1.0.jar', PUT, JSON ) { req ->

        body = [
            uri: "http://artifactory:8888/libs-snapshot-local/my/jar/1.0/test-jar-1.0.jar",
            downloadUri: "http://artifactory:8888/libs-snapshot-local/my/jar/1.0/test-jar-1.0.jar",
            repo: "libs-snapshot-local",
            path: "c:\\pathtojarfile\\test.jar",
            created: "2012-02-03T08:37:12.599-0800",
            createdBy: "someuser",
            size: "1024",
            mimeType: "application/java-archive"

        ]

    response.success = { resp, json ->


    }

  }

This seems to get me part way there, but it uploads an empty jar file. Seems like the body is completely ignored. Removing it produces the same result. I can’t seem to find a good reference on how this is done.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:23:39+00:00Added an answer on May 29, 2026 at 1:23 pm

    The JSON in the mentioned documentation is actually Artifactory’s response to the deployment request.
    For deployment, Artifactroy requires only a simple PUT request, for example:

    def restClient = new RESTClient('http://localhost:8080/artifactory/libs-release-local/')
    restClient.auth.basic 'username', 'password'
    restClient.encoder.'application/zip' = this.&encodeZipFile
    def encodeZipFile(Object data) throws UnsupportedEncodingException {
        def entity = new FileEntity((File) data, 'application/zip');
        entity.setContentType('application/zip');
        return entity
    }
    def response = restClient.put(path: 'org/artifact/1.0/artifact-1.0.jar',
          body: new File('/path/to/local/artifact.jar'),
          requestContentType: 'application/zip'
    ) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this C API declaration how would it be imported to C#? int _stdcall
From the documentation it looks like this is not possible, but I want to
Given this algorithm, I would like to know if there exists an iterative version.
Given the hpricot xml at the bottom of this post, how would I select
I would like to do the following, but I'm not sure I'm using the
In the Hadoop API documentation it's given that setJarByClass public void setJarByClass(Class<?> cls) Set
This is the only official documentation available for the Halo: Reach stats API. If
Given this HTML: <ul id=topnav> <li id=topnav_galleries><a href=#>Galleries</a></li> <li id=topnav_information><a href=#>Information</a></li> </ul> And this
Given this XML, what XPath returns all elements whose prop attribute contains Foo (the
Given this class class Foo { // Want to find _bar with reflection [SomeAttribute]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.