Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for storing the result code and output in properties #21

Closed
GoogleCodeExporter opened this issue Mar 13, 2016 · 13 comments
Closed

Comments

@GoogleCodeExporter
Copy link

It would be nice to be able to store the result code (e.g. 200, 404) in a 
property so that it can be used for controlling the subsequent flow in the Ant 
script.

The same goes for the output from a request, e.g. GET.

I have implemented this in a local copy but as I have incorporated in the patch 
in issue 13, a patch would not be that short and sweet. Anyway, it is trivial 
to implement this.


Original issue reported on code.google.com by anders.j...@gmail.com on 16 Aug 2011 at 11:20

@GoogleCodeExporter
Copy link
Author

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 12:55

  • Changed state: Accepted
  • Added labels: Milestone-1.1.3, OpSys-All, Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 12:55

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Added an attribute to the root http task "statusProperty" which defines a 
property to save the response status to.  For example:

  <target name="get">
    <http url="http://www.google.com/asfaf" statusProperty="out.status" failOnUnexpected="false"/>
    <echo message="Response Status: ${out.status}"/>
  </target>

Will be available in the 1.1.3 release

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 1:11

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Great!

Would it be possible to add outputProperty as well?

Original comment by anders.j...@gmail.com on 18 Aug 2011 at 1:16

@GoogleCodeExporter
Copy link
Author

Whoops,  missed that part.. need to redact 1.1.3 that I'm in the middle of 
releasing

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 2:44

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Added an attribute to the root http task "entityProperty" which defines a 
property to save the response entity to.  For example:

  <target name="http-get">
    <http url="http://www.google.com" entityProperty="ent"/>
    <echo message="resp: ${ent}"/>
  </target>

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 2:54

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Great!

Would it be possible to add headerProperty as well?  That way, one could save 
the entire set of headers, from which one could extract values.

Our specific use case is to save the cookie value returned an initial response, 
to be used in subsequent requests.

Original comment by aronrobe...@gmail.com on 18 Aug 2011 at 6:48

@GoogleCodeExporter
Copy link
Author

I can, but i already did 1.1.3 this morning.. If you like, open up a new 
enhancement issue and i'll do a quick 1.1.4 release

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 9:09

@GoogleCodeExporter
Copy link
Author

What would you expect this to look like? I wouldn't want to dump all headers 
into a string, then formatting etc would have to be assumed

maybe something like

<http ...>
  <saveHeader name="Cookie-X" property="my.prop"/>
</http>

Original comment by alex.she...@gmail.com on 18 Aug 2011 at 9:11

@GoogleCodeExporter
Copy link
Author

Thanks, Alex!

Being able to save the value of any specific header to a property would be 
terrific - far better than having to parse a monolithic string containing all 
of the headers and their values.

How do you suggest handling values of headers, like Set-Cookie, that can appear 
more than once in a response?

(Thanks as well, Anders, for your contributions - much appreciated!)

Original comment by aronrobe...@gmail.com on 19 Aug 2011 at 5:48

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

See Issue 24 for a continuation of the discussion for saving header values

Original comment by alex.she...@gmail.com on 19 Aug 2011 at 12:31

@GoogleCodeExporter
Copy link
Author

Original comment by alex.she...@gmail.com on 19 Aug 2011 at 12:51

  • Added labels: Project-ant-http

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant