{"id":3204,"date":"2014-03-20T02:40:41","date_gmt":"2014-03-20T02:40:41","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/20\/how-do-i-make-php-page-return-a-503-error-or-anything-non-200-collection-of-common-programming-errors\/"},"modified":"2014-03-20T02:40:41","modified_gmt":"2014-03-20T02:40:41","slug":"how-do-i-make-php-page-return-a-503-error-or-anything-non-200-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/20\/how-do-i-make-php-page-return-a-503-error-or-anything-non-200-collection-of-common-programming-errors\/","title":{"rendered":"How do I make php page return a 503 error (or anything non-200)-Collection of common programming errors"},"content":{"rendered":"<p>A former developer wrote or client-server api in PHP. It simply sends messages as xml using post\/response in a very simplistic fashion. The problem is that even when there is an error (ex: invalid arguments passed into the server side) we get a HTTP 200 response with a page like this<\/p>\n<h4><code>Unknown error!<\/code><\/h4>\n<pre>\n<\/pre>\n<p><code>In firebug I can see that the actually HTTP response is a 200. How can we send a different response (ie:503) when we programatically detect in our php code that it is appropriate to do so.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A former developer wrote or client-server api in PHP. It simply sends messages as xml using post\/response in a very simplistic fashion. The problem is that even when there is an error (ex: invalid arguments passed into the server side) we get a HTTP 200 response with a page like this Unknown error! In firebug [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3204","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3204"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3204\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}