The API documentation says:
All calls return JSON, and you can generally get an HTML representation by adding .html on the end.
and
Whenever an error is returned from MapIt, it is as a dictionary with an error key …
but for example https://mapit.mysociety.org/postcode/F-54110 returns a HTML page.