Skip to content

Instantly share code, notes, and snippets.

View patrys666's full-sized avatar

Patryk patrys666

View GitHub Profile
@magnetikonline
magnetikonline / dumprequest.php
Last active December 1, 2024 09:58
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']