Sometimes the interaction with a certain server is not what we expected. A typo on a URL might get us a 404—Not Found error. At other times, when we assemble URL arguments via code, we miss one or forget to encode them properly, the server, totally baffled, might reply in ways we didn't expect. It often happens that the server returns a nicely formatted HTML page explaining the error when we were expecting an XML or JSON reply. The receiving code on the client side gets confused by such a message intended for humans not for code.
It is good to check out what actually gets sent and received. Firebug already shows that in the Net tab; other browsers may or may not have similar features. In those cases, a tool such as Fiddler (http://www.fiddler2.com/) or Wireshark (http://www.wireshark.org/) is a good choice; both are free.
Fiddler works only on Windows and it is oriented towards web traffic (mostly HTTP) so it is an easier tool to use. Wireshark works on Windows, Mac...