protected static function get_hold_response($response)
    {
        $iresponse = null;
        if (!is_null($response)) {
            if (is_string($response)) {
                $response = new Response(null, null, null, $response);
            }
            $iresponse = array();
            if (!is_null($response->code)) {
                $iresponse['code'] = $response->code;
            }
            if (!is_null($response->reason)) {
                $iresponse['reason'] = $response->reason;
            }
            if (!is_null($response->headers) && count($response->headers) > 0) {
                $iresponse['headers'] = $response->headers;
            }
            if (!is_null($response->body)) {
                if (Encoding::is_binary_data($response->body)) {
                    $iresponse['body-bin'] = base64_encode($response->body);
                } else {
                    $iresponse['body'] = $response->body;
                }
            }
        }
        return $iresponse;
    }