Skip to content

Instantly share code, notes, and snippets.

View sdennler's full-sized avatar

Samuel Dennler sdennler

View GitHub Profile
@sdennler
sdennler / dumprequest.php
Last active August 18, 2017 15:12 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method/HTTP headers and request body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequest {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
);