You are here

public function FeedsHTTPFetcherAppendHeaders::request in Feeds HTTPFetcher Append Headers 7

Implements FeedsFetcher::request().

File

plugins/FeedsHTTPFetcherAppendHeaders.inc, line 78
Home of the FeedsHTTPFetcherAppendHeaders and related classes.

Class

FeedsHTTPFetcherAppendHeaders
Fetches data via HTTP and appending custom headers.

Code

public function request($feed_nid = 0) {
  feeds_dbg($_GET);
  @feeds_dbg(file_get_contents('php://input'));
  try {
    feeds_source($this->id, $feed_nid)
      ->existing()
      ->import();
  } catch (Exception $e) {

    // In case of an error, respond with a 503 Service (temporary) unavailable.
    header('HTTP/1.1 503 "Not Found"', NULL, 503);
    drupal_exit();
  }

  // Will generate the default 200 response.
  header('HTTP/1.1 200 "OK"', NULL, 200);
  drupal_exit();
}