Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Cron2250
2013-02-24T17:11:38Z
It's easy to set up a loop to do an HTTP transaction several times (i.e. waiting for a particular result), but I'm not clear on how to get results from the HTTP transaction so I can act on them. At a minimum, I think I'd want to get the HTTP Status Code into a variable, but potentially also the body and/or certain headers from the response. Hopefully, I don't have to save the body to a file and then retrieve it from there? But even then, how would I get the HTTP Status Code?

Also, in the loop, there is "maximum iterations", so that's how I stop it if it hasn't gotten the result I'm looking for after some period of time. But what happens at that point? Does the job fail? Does the job continue to the next task after the loop?
Sponsor
Forum information
Support
2013-02-26T11:30:54Z
Originally Posted by: Cron2250 

It's easy to set up a loop to do an HTTP transaction several times (i.e. waiting for a particular result), but I'm not clear on how to get results from the HTTP transaction so I can act on them. At a minimum, I think I'd want to get the HTTP Status Code into a variable, but potentially also the body and/or certain headers from the response. Hopefully, I don't have to save the body to a file and then retrieve it from there? But even then, how would I get the HTTP Status Code?

Also, in the loop, there is "maximum iterations", so that's how I stop it if it hasn't gotten the result I'm looking for after some period of time. But what happens at that point? Does the job fail? Does the job continue to the next task after the loop?



Currently we do not log headers or response code. I am moving this topic to Feature requests.

After maximum iterations it goes to next Task without error.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Cron2250
2013-02-26T14:15:49Z
OK, well that would be a good new feature ;)

In the mean time, what about the response body? Is there a way to get it into a user variable without having to save it to a file and the read the file? (Which is the only way I can currently see to do it).
Support
2013-02-26T14:20:56Z
Just use the output of the Task.

For example (if you want previous Task):

{TASK(PrevTask,StdOut)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Cron2250
2013-02-26T14:24:56Z
OK. If that task is an HTTP GET, does that reference (the StdOut) automatically contain the response body content or do I need to do something special in the HTTP task to get it there?
Support
2013-02-26T14:29:19Z
The body content - nothing special.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top