Ant的RESTful httpclient
我需要一个用于Ant的RESTful httpclient 所有与contrib相关的任务似乎都不起作用了Ant的RESTful httpclient,http,rest,ant,post,httpclient,Http,Rest,Ant,Post,Httpclient,我需要一个用于Ant的RESTful httpclient 所有与contrib相关的任务似乎都不起作用了 还没有人连接Commons HTTPClient和Ant吗?尝试使用Ant exec任务,我找到了这个项目 最后一次文件更新是2007-03-12,所以我有点担心质量 这里有它的用户吗?中有一个http post任务,但它似乎不支持基本身份验证:/ 我使用了CURL from ANT来发布带有以下宏定义的文件: <pathconvert property="curl.path" ta
还没有人连接Commons HTTPClient和Ant吗?尝试使用Ant exec任务,我找到了这个项目 最后一次文件更新是2007-03-12,所以我有点担心质量
这里有它的用户吗?中有一个http post任务,但它似乎不支持基本身份验证:/ 我使用了CURL from ANT来发布带有以下宏定义的文件:
<pathconvert property="curl.path" targetos="windows">
<path location="${lib.dir}/curl/curl.exe"/>
</pathconvert>
<macrodef name="post-file" description="Use Curl to post the file to the WEBDAV path">
<attribute name="file"/>
<attribute name="url" />
<attribute name="username" default="${username}" />
<attribute name="password" default="${password}" />
<sequential>
<echo message="Using CURL to upload @{file} to @{url}" />
<!--Execute curl to post the file to the URL -->
<exec executable="${curl.path}">
<arg value='-L'/>
<arg value='-k'/>
<arg value='-f'/>
<arg value='-s'/>
<arg value="--anyauth"/>
<arg value="-u"/>
<arg value="@{username}:@{password}"/>
<arg value="-T" />
<arg value='"@{file}"' />
<arg value='@{url}'/>
</exec>
</sequential>
</macrodef>
按如下方式执行宏定义:
<target name="test-upload">
<post-file file="${file}"
url="${url}"
username="${username}"
password="${password}" />
</target>
现在就做。但对于windows服务器来说,这并不太好。加上-D参数在AntI内部无法正常工作,我很好奇:你到底想做什么?发布到servlet。(ApacheSolr代理)我尝试了FikinAnt任务,但它的基本身份验证支持被破坏了。