← Back to team overview

mahara-contributors team mailing list archive

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

 

Adding the patch...

** Description changed:

  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);
+     $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);
+     $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);

** Patch added: "bug1080352.patch"
   https://bugs.launchpad.net/mahara/+bug/1080352/+attachment/3437583/+files/bug1080352.patch

-- 
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


References