Home > Uncategorized > apache ant http task 1.1 released

apache ant http task 1.1 released

Due to a glaring feature omission from version 1.0, the ability to write the response entity to file, I’ve added a new attribute to the ant task to support this and moved the project to version 1.1.

The new version with updated documentation, samples and downloads can be found on the google code site http://code.google.com/p/missing-link/.

Sample usage to write an entity to file:

<?xml version="1.0" encoding="UTF-8"?>
<project name="ml-ant-http" basedir="." default="http-get">

<property name="ml-ant-http.jar" value="ml-ant-http-1.1.jar"/>

<fileset id="runtime.libs" dir=".">
<include name="${ml-ant-http.jar}"/>

<path id="runtime.classpath">
<fileset refid="runtime.libs"/>

<taskdef name="http" classname="org.missinglink.ant.task.http.HttpClientTask">
<classpath refid="runtime.classpath"/>

<target name="http-get">
<http url="http://www.google.com/images/logos/ps_logo2.png" method="GET" outfile="google.png"/>
Categories: Uncategorized
  1. David Scott
    July 22, 2011 at 4:59 pm

    I’m evaluating this tool, and I think I found a bug in the URL-parsing code around the handling of multiple decimal points. If I call like this:

    The output correctly states the URL is “http://www.google.com/my_file.zip” with no query parameters. However if I call like this:

    The output URL is listed as “http://www.google.com/my_file-1.0?.zip” (note the addition of an incorrect question mark) and the query parameters are listed as “.zip=null”. I guess the problem is in “HttpClient.java” in the definition of the URL_REGEX pattern.

    • Alex
      July 22, 2011 at 5:39 pm

      Hi David,

      I’ll take a look tonight and/or over the weekend. However, in the mean time, your comment seems to have lost some data?

      You say “if I call like this” twice, but I don’t see any example url’s, just the following results you showed

  2. David Scott
    July 22, 2011 at 6:28 pm

    I think the comment system did not like my use of XML. Here is the missing content with the angle brackets removed:

    http url=”http://www.google.com/my_file.zip” printrequest=”true”

    http url=”http://www.google.com/my_file-1.0.zip” printrequest=”true”

    Thanks for taking a look at this so quickly. I might just fix it myself since I am able to compile the source and I think I know which reg-exp has the problem, so don’t worry if you are not able to get to it.

    • Alex
      July 22, 2011 at 11:29 pm

      Hi David,

      I’ve released 1.1.2 with this issue fixed, along with others. Please check for the latest blog post for details.

      Thanks for trying my ant task!

      • David Scott
        July 25, 2011 at 12:23 pm

        Thanks for the quick bug fix! I tried 1.1.2 and it is working great. You have saved me a lot of time. Just in case you were curious what I’m doing, I’m trying to write an Ant-based interface to administering a Day.com CRX server.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: