ArnsboMedia/opengraph_parser

View on GitHub
src/OpenGraphParser/HttpFetchStrategy.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace OpenGraphParser;
class HttpFetchStrategy extends AbstractFetchStrategy {
    protected function get_content($uri) {
        $client = new \GuzzleHttp\Client();
        $response = $client->get($uri);
        if($response->getStatusCode()!=200) throw new OpenGraphFetchException;
        return $response->getBody();
    }
}