{"id":3080,"date":"2020-07-16T15:37:46","date_gmt":"2020-07-16T14:37:46","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=3080"},"modified":"2023-06-16T11:27:41","modified_gmt":"2023-06-16T10:27:41","slug":"return-http-200-response","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/page-control\/return-http-200-response","title":{"rendered":"Return HTTP response before continuing"},"content":{"rendered":"\n<p>Return HTTP 200 response before continuing processing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/\/--------------------------------------------\n  \/\/----- RETURN HTTP RESPONSE IMMEDIATELY -----\n  \/\/--------------------------------------------\n  $OutputHtml = null;\n\n  \/\/$OutputHtml = \/\/&lt;&lt;&lt;Set content if you want to return content&lt;&lt;&lt;&lt;&lt;&lt;\n\n  \/\/Check if fastcgi_finish_request is callable\n  if (is_callable('fastcgi_finish_request'))\n  {\n    if ($OutputHtml !== null)\n      echo $OutputHtml;\n\n    session_write_close();      \/\/Close the session\n    ignore_user_abort(True);    \/\/Prevent echo, print, and flush from killing the script\n    fastcgi_finish_request();   \/\/This returns 200 to the user, and processing continue\n  }\n  else\n  {\n    ignore_user_abort(true);    \/\/Prevent echo, print, and flush from killing the script\n    ob_start();\n\n    if ($OutputHtml !== null)\n      echo $OutputHtml;\n    \n    header('Connection: close');\n    header('Content-Length: '.ob_get_length());\n    ob_end_flush();\n    ob_flush();\n    flush();\n  }\n  \/\/CARRY ON HANDLING SCRIPT AS SLOWLY AS YOU WANT WITH RESPONSE ALRERADY SENT<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Return HTTP 200 response before continuing processing<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,225],"tags":[],"class_list":["post-3080","post","type-post","status-publish","format-standard","hentry","category-page-control","category-threads"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=3080"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3080\/revisions"}],"predecessor-version":[{"id":4514,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/3080\/revisions\/4514"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=3080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=3080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=3080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}