theckman / he-ipv4-perl

Perl script to automatically update Hurricane Electric IPv6 Tunnel Endpoint Address
4 stars 3 forks source link

Return status #6

Open mliljedahl opened 11 years ago

mliljedahl commented 11 years ago

Hi!

Nice script! As you say in your comment "kind of risky I suppose assuming HTTP 200 = success" when trying to update the end point, you can use $mech->response->decoded_content and check the return message. There api are not using status codes so almost all requests will be status 200.

//Markus

theckman commented 11 years ago

Hey Markus,

I'll say it's definitely been awhile so I'm only guessing here at what past-self was thinking. As I remember it, even when some sort of failure happened the HTTP status code was 200 which in most cases for an API is acceptable. The HTTP request happened perfectly, the operation did not.

You are correct, the ultimate goal should have been to check the return message from Hurricane Electric to determine whether or not there was a failure. I don't personally see myself adding that check to the code, but if you (or someone else) were to add it I would gladly merge it in to the script to make it better for everyone.

If it doesn't happen, I may make it a weekend project to make it better. Thanks for reaching out to me.

-Tim