← Back to team overview

mahara-contributors team mailing list archive

[Bug 1080352] [NEW] mahara_http_request function doesn't returns request data (should split header and body)

 

Public bug reported:

When using mahara_http_request function (lib/web.php) it returns the response of request in the following format:
    $result = new StdClass();
    $result->data = curl_exec($ch);
    $result->info = curl_getinfo($ch);
    $result->error = curl_error($ch);
    $result->errno = curl_errno($ch);

It would be very useful to separate or split data part into header and
body parts, like:

    $result = new StdClass();
    $result->data = curl_exec($ch);
    // Parse out header and body
    $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
    $result->header = substr($result->data, 0, $header_size);
    $result->body = substr($result->data, $header_size);
    $result->info = curl_getinfo($ch);
    $result->error = curl_error($ch);
    $result->errno = curl_errno($ch);

** Affects: mahara
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/1080352

Title:
  mahara_http_request function doesn't returns request data (should
  split header and body)

Status in Mahara ePortfolio:
  New

Bug description:
  When using mahara_http_request function (lib/web.php) it returns the response of request in the following format:
      $result = new StdClass();
      $result->data = curl_exec($ch);
      $result->info = curl_getinfo($ch);
      $result->error = curl_error($ch);
      $result->errno = curl_errno($ch);

  It would be very useful to separate or split data part into header and
  body parts, like:

      $result = new StdClass();
      $result->data = curl_exec($ch);
      // Parse out header and body
      $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
      $result->header = substr($result->data, 0, $header_size);
      $result->body = substr($result->data, $header_size);
      $result->info = curl_getinfo($ch);
      $result->error = curl_error($ch);
      $result->errno = curl_errno($ch);

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1080352/+subscriptions


Follow ups

References