antlibs / ant-http

A fork of missing link Ant HTTP task at Google Code
https://code.google.com/archive/p/missing-link/
Apache License 2.0
7 stars 3 forks source link

Setting printrequestheaders and printresponseheaders to false doesn't do anything. #30

Closed twogee closed 7 years ago

twogee commented 9 years ago

Issue by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT Originally opened as https://github.com/twogee/missing-link/issues/30


The following should output just the body of the HTTP response:

    <http url="http://domain/etc"
        entityProperty       = "HttpResponse"
        failonunexpected     = "false"
        printrequestheaders  = "false"
        printresponseheaders = "false"
        />
    <echo>${HttpResponse}</echo>

Instead, it is preceeding the echo with:

     [http] HTTP Request
     [http] ********************
     [http] URL:        http://domain/etc
     [http] Method:     GET
     [http] HTTP Response
     [http] ********************
     [http] Status:     200

Which is clogging up the output.

Using missing-link 1.1.3 with Ant 1.8.2

Original issue reported on code.google.com by bought...@gmail.com on 8 Jan 2012 at 8:07

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


I have an authentication token in the header and I would prefer it not being 
sent to std out

Original comment by supert...@gmail.com on 4 May 2014 at 8:51

twogee commented 9 years ago

Comment by GoogleCodeExporter Monday May 11, 2015 at 22:05 GMT


Looking at the source it seems you already have accounted for this except the 
if statement @ line 283 in HttpClientTask.java

 if (httpClient.getHeaders().size() > 0 && printRequestHeaders) {

Great library by the way.. Thanks !

Original comment by supert...@gmail.com on 4 May 2014 at 8:55