You are here

function dsq_get_http_headers_for_request in Drupal Most Popular 7

2 calls to dsq_get_http_headers_for_request()
_dsq_fopen_urlopen in modules/mostpopular_disqus/disqusapi/url.php
_dsq_fsockopen_urlopen in modules/mostpopular_disqus/disqusapi/url.php

File

modules/mostpopular_disqus/disqusapi/url.php, line 46

Code

function dsq_get_http_headers_for_request($boundary, $content, $file_name, $file_field) {
  $headers = array();
  $headers[] = 'User-Agent: ' . USER_AGENT;
  $headers[] = 'Connection: close';
  if ($content) {
    $headers[] = 'Content-Length: ' . strlen($content);
    if ($file_name && $file_field) {
      $headers[] = 'Content-Type: multipart/form-data; boundary=' . $boundary;
    }
    else {
      $headers[] = 'Content-Type: application/x-www-form-urlencoded';
    }
  }
  return implode("\r\n", $headers);
}