Skip to content

Instantly share code, notes, and snippets.

@muhqu
Created March 1, 2011 14:35
Show Gist options
  • Select an option

  • Save muhqu/849206 to your computer and use it in GitHub Desktop.

Select an option

Save muhqu/849206 to your computer and use it in GitHub Desktop.
<?php
// WTF!
file_get_contents("http://127.0.0.1:31337/v1/posts/adjacent/65f1685dd814524417705a9bcd03e9e7?limit=5", false,
stream_context_create(array('http'=>array(
'method' => "GET",
'header' => array("Host: api.domain.com"),
'timeout' => 2,
))));
// 50% of request:
// GET /v1/posts/adjacent/65f1685dd814524417705a9bcd03e9e7?limit=5 HTTP/1.1
// User-Agent: PHP/5.3.5
// Host: 127.0.0.1:31337
// Accept: */*
// 50% of request:
// GET /v1/posts/adjacent/65f1685dd814524417705a9bcd03e9e7?limit=5 HTTP/1.1
// User-Agent: PHP/5.3.5
// Accept: */*
// Host: api.domain.com
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment