You may know already, but a lesser known feature of php is that you can pass a [stream context](http://php.net/manual/en/function.stream-context-create.php) as optional argument to most file-operations. This enables you to make fine grained http-control (post, headers etc.), still using `file_get_contents` and friends.