Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4010052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:57:10+00:00 2026-05-20T08:57:10+00:00

Hi wondring whats the difference between $response->getBody() and $response->getRawBody(); $this->_client->setUri(‘http://www.google.com/ig?hl=en’); try { $response =

  • 0

Hi wondring whats the difference between $response->getBody() and $response->getRawBody();

$this->_client->setUri('http://www.google.com/ig?hl=en');
        try {
            $response = $this->_client->request();
        }catch(Zend_Http_Exception $e)
        {
            echo 'Zend http Client Failed';
        }
        echo get_class($response);
        if($response->isSuccessful())
        {
           $response->getBody();
           $response->getRawBody();

        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:57:10+00:00Added an answer on May 20, 2026 at 8:57 am

    getRawBody() returns the body of the http response as is.

    getBody() adjust for certain headers i.e. decompresses content sent with gzip or deflate content-encoding headers. Or the chunked transfer-encoding header.

    The simplest way figure these questions out in to simply look at the code. Also a great learning experience. Code is edited for brevity.

    public function getRawBody()
    {
        return $this->body;
    }
    
    public function getBody()
    {
        $body = '';
    
        // Decode the body if it was transfer-encoded
        switch (strtolower($this->getHeader('transfer-encoding'))) {
            case 'chunked':
                // Handle chunked body
                break;
            // No transfer encoding, or unknown encoding extension:
            default:
                // return body as is
                break;
        }
    
        // Decode any content-encoding (gzip or deflate) if needed
        switch (strtolower($this->getHeader('content-encoding'))) { 
            case 'gzip':
                 // Handle gzip encoding
                break;
            case 'deflate':
                // Handle deflate encoding
                break;
            default:
                break;
        }
    
        return $body;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering whats the difference between store() and add()? They seem very similar,
I wondering whats the difference between url and destination using httpservice in flex. I
I was wondering what is the difference between this file when we are talking
Just wondering about this one : Whats the difference, or is there a difference
I'm wondering what's the difference between this code: var c = [{test: 1}]; and
I am wondering whats the difference between inheritFrom and the prototype when defining inheritance
Possible Duplicate: very simple delegate musing I've been wondering what's the difference between this
Just wondering what the difference between BeginInvoke() and Invoke() are? Mainly what each one
Just wondering what the difference between MFC control messages prefixed with the following is:
I've been wondering what the difference between embedding <requestedExecutionLevel level=asInvoker uiAccess=false /> and <requestedExecutionLevel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.