Mercury: Venus: Earth: Mars: Jupiter: Saturn: Uranus: Neptune: Pluto:
Explanation of Web Page Functionality
The aforementioned request string is sent off to a PHP-based Web Service. If this Web Service receives a correctly-formatted request string, it responds with an HTTP header of ‘200 OK’ and an XML document consisting of a
planet root node and the following child nodes:
sunlightToPlanet. Each time a planet is selected, the elements relating to metres/kilometres from itself are not included in the output XML document. The statistics included in the XML document are then output in ‘bullet-pointed’ format, using a small image of the relevant planet as the ‘bullet point’ for each statistic.
If this Web Service receives an incorrectly-formatted request string, it responds with an HTTP header of ‘400 Bad Request’ and a paragraph of text that explains the expected request string format. You can test this response by clicking the ‘Send XMLHttpRequest’ button without selecting a planet; the explanatory paragraph will be displayed above.
The Web Service will only respond with either a ‘200 OK’ or ‘400 Bad Request’ HTTP header. For all other communication issues – for example, a loss of internet connection – an error message will be displayed in red font, informing the user that an ‘unforeseen communication issue’ has occurred.