Re: How to set content type in "get" task?

"Scot P. Floess" <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
I've kept your email in my inbox wanting to see if I could help.

Now that I'm trying - I'm surprised you can't specify the Content-Type.  I 
do a fair bit of REST work so I absolutely understand your desire for this 
functionality.  I found ant-contrib has a post task but that won't help 
you.

Might be worth submitting a feature request or write something in a 
scripting language (my go-to is usually Beanshell).  However maybe 
Javascript?  Essentially put a script-def in place in your ant script.

There maybe better solutions but I noted nobody responded to date - so 
thought I'd give my $0.02.

Probably pretty easy to add this via a script-def...let me know if it 
doesn't make sense or you are curious...


On Wed, 16 Mar 2016, Al Le wrote:

> Hello,
>
> in our ant script, we use the "get" task to fetch some data from the server via HTTP GET. The server interprets the 'Content-Type' header of the request and delivers the response in the appropriate format (html/xml/json).
>
> We'd like to have the result as XML and hence would need to set the content type header of the HTTP request.
>
> Is this possible using the standard get task? If yes, how?
>
> I've only found the 'useragent' attribute in the task but no means to set some other HTTP headers.
>
> Thanks!
> AL
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Scot P. Floess             RHCT  (Certificate Number 605010084735240)
Chief Architect FlossWare  http://sourceforge.net/projects/flossware
                            http://flossware.sourceforge.net
                            https://github.com/organizations/FlossWare
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.