GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cision-block/src/Plugin/Http/RemoteRequest.php at master · Cyclonecode/cision-block Expand file tree/ Copy pathRemoteRequest.phpMore file actions 39 lines (37 loc) · 1.22 KB / Copy pathRemoteRequest.phpFile metadata and controls39 lines (37 loc) · 1.22 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 <?php namespace CisionBlock\Plugin\Http; class RemoteRequest extends AbstractRequest { /** * Performs a remote request. * @param string $url * @param array $args * @return false|string * @throws \Exception */ public function execute($url, array $args = array()) { $defaults = array( 'method' => self::VERB_GET, 'timeout' => self::CURL_TIMEOUT, 'headers' => $this->headers, ); $args = array_merge($defaults, $args); $response = wp_safe_remote_request($url, $args); if (!is_wp_error($response) && in_array(wp_remote_retrieve_response_code($response), array(200, 201))) { $result = new Response( wp_remote_retrieve_body($response), wp_remote_retrieve_headers($response), wp_remote_retrieve_response_code($response) ); } else { $code = wp_remote_retrieve_response_code($response); /** @var \WP_Error|array $response */ throw new \Exception( ($response instanceof \WP_Error ? $response->get_error_message() : ''), $code ? $code : 500 ); } return $result; } } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |