public function send()
    {
        //@TODO when returning the location header during
        //test it fetches the new location even though the
        //code is not redirect
        $this->getResponse()->setContentType('application/json');
        $headers = $this->getResponse()->getHeaders();

        if (isset($headers['Location'])) {
            $headers['Content-Location'] = $headers['Location'];
            unset($headers['Location']);
        }

        //If not padding is set inspect the request query.
        if (empty($this->_padding)) {
            $request = $this->getResponse()->getRequest();
            if ($request->has('callback')) {
                $this->setCallback($request->get('callback'));
            }
        }

        return parent::send();
    }
public function send()
    {
        //@TODO when returning the location header during
        //test it fetches the new location even though the
        //code is not redirect
        $this->getResponse()->setContentType('application/json');
        $headers = $this->getResponse()->getHeaders();

        if (isset($headers['Location'])) {
            $headers['Content-Location'] = $headers['Location'];
            unset($headers['Location']);
        }

        //If not padding is set inspect the request query.
        if (empty($this->_padding)) {
            $request = $this->getResponse()->getRequest();
            if ($request->has('callback')) {
                $this->setCallback($request->get('callback'));
            }
        }

        return parent::send();
    }
public function send ( ) { //@TODO when returning the location header during //test it fetches the new location even though the //code is not redirect $ this -> getResponse ( ) -> setContentType ( 'application/json' ) ; $ headers = $ this -> getResponse ( ) -> getHeaders ( ) ; if ( isset ( $ headers [ 'Location' ] ) ) { $ headers [ 'Content-Location' ] = $ headers [ 'Location' ] ; unset ( $ headers [ 'Location' ] ) ; } //If not padding is set inspect the request query. if ( empty ( $ this -> _padding ) ) { $ request = $ this -> getResponse ( ) -> getRequest ( ) ; if ( $ request -> has ( 'callback' ) ) { $ this -> setCallback ( $ request -> get ( 'callback' ) ) ; } } return parent :: send ( ) ; }
Send HTTP response.

If not padding is set inspect the request query for a 'callback' parameter and use this.

@see http://tools.ietf.org/html/rfc2616

@return DispatcherResponseTransportJson
Send HTTP response .