Ajax Response Header

You may want to send back your own headers via php after a request against the server as a response. Unlike xajax, this goes with jybrid.

    $hash = md5((string) random_int(1, 100));
    /**
     * Sets php-response-header. Detects automatically the request-type (GET or POST)
     * Will be response while GET and POST requests *
     */
    Jybrid\Response\Manager::getInstance()->getHeader()->addHeaderCommon('custom-playground', $hash);
    /**
     * Only Response during POST (because of automatically Request-Method detection)
     */
    Jybrid\Response\Manager::getInstance()->getHeader()->addHeaderPost('custom-playground-during-post', 'post-' . $hash);
    /**
     * Only Response during GET (because of automatically Request-Method detection)
     */
    Jybrid\Response\Manager::getInstance()->getHeader()->addHeaderGet('custom-playground-during-GeT', 'Get-' . $hash);

further reading ajax examples

@see schematic-ajax-http-request-response-header.php