You are here

public function FeedsHTTPBatch::getRaw in Feeds 7

Same name and namespace in other branches
  1. 6 plugins/FeedsHTTPFetcher.inc \FeedsHTTPBatch::getRaw()

Implements FeedsImportBatch::getRaw();

Overrides FeedsImportBatch::getRaw

File

plugins/FeedsHTTPFetcher.inc, line 29

Class

FeedsHTTPBatch
Definition of the import batch object created on the fetching stage by FeedsHTTPFetcher.

Code

public function getRaw() {
  feeds_include_library('http_request.inc', 'http_request');
  $result = http_request_get($this->url);
  if (!in_array($result->code, array(
    200,
    201,
    202,
    203,
    204,
    205,
    206,
  ))) {
    throw new Exception(t('Download of @url failed with code !code.', array(
      '@url' => $this->url,
      '!code' => $result->code,
    )));
  }
  return $result->data;
}