简体   繁体   中英

How does one configure logging in HttpBuilder-NG to see what is going back and forth

I am exploring using HttpBuilder-NG to perform REST calls. My first attempt simply gives me a groovy.net.http.HttpException with a traceback. No other details. Using the previous HttpBuilder I was able to turn on logging to see what is sent and received.

The code is pretty simple:

    def jiraUrl = 'https://gpdevjira.broadinstitute.org:8443/rest/api/2'
def username = 'releng'
def password = 'releng'


@Test
void testGetIssue() {

    def jira = configure {
        request.uri = jiraUrl
        request.auth.basic username, password
    }

    assert jira

    String text = jira.get(String){
        request.uri.path = "/issue/$testIssue"
    }

    assert text
}

我认为已经回答了使用HttpBuilder-NG的Apache客户端实现的建议

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM