Parse a raw HTTP response
547938
public static function fromRaw($raw){
			$response = new Response();

			$header_end_offset = strpos($raw, "\r\n\r\n");
			$raw_head = substr($raw, 0, $header_end_offset);
			$raw_body = substr($raw, $header_end_offset+4);
			$raw_headers = explode("\r\n", $raw_head);
			$status_head = array_shift($raw_headers);
			$status_segments = explode(" " , $status_head);

			$status = new stdClass();
			$status->protocol = $status_segments[0];
			$status->code = (int)$status_segments[1];
			$status->message = $status_segments[2];

			$headers = array();
			foreach($raw_headers as $header){
				$segments = explode(": ", $header, 2);
				$headers[$segments[0]] = $segments[1];
			}

			$response->status = $status;
			$response->headers = $headers;
			$response->body = $raw_body;

			return $response;
		}
1137869
def parse_response(self, response):
        """"""
        try:
            for header in response.getheader("set-cookie").split(", "):
                # filter 'expire' information
                if not header.startswith("D"):
                    continue
                cookie = header.split(";", 1)[0]
                cookieKey, cookieValue = cookie.split("=", 1)
                self._cookies[cookieKey] = cookieValue
        finally:
            return Transport.parse_response(self, response)
503670
def parse_response(response:, params: nil, body: {})
      if response.code < 299
        body[:data] = parse_json(response.body)
        body[:success] = true
      else
        error = write_error_message(response)
        body[:error] = error
        body[:success] = false
      end
      body[:code] = response.code
      body.merge!(raw: { body: response.body, params: params })
    end
954612
def raw_response(json, status)
      json.empty? ? {} : JSON.parse(json, symbolize_names: true)
    rescue StandardError
      { message: json, code: status }
    end
672641
def parse_response(object)
      LOG.debug("response is #{object}")
      case object
        when ::Net::HTTPUnauthorized
          ::File.delete(ACCESS_TOKEN)
          raise 'user revoked oauth connection'
        when ::Net::HTTPOK then
          object.body
      end
    end
307445
def parse_response(res)
      begin
        data = JSON.parse(res.body)
        if data.nil? == false && data.has_key?("result") && data["result"].nil? == false
          return data["result"]
        elsif data.nil? == false && data.has_key?("error") && data["error"].nil? == false
          raise CallrException.new(data["error"]["message"], data["error"]["code"], nil)
        else
          raise CallrException.new("INVALID_RESPONSE", -3, {:response => res.body})
        end
      rescue JSON::ParserError
        raise CallrException.new("INVALID_RESPONSE", -3, {:response => res.body})
      end
    end
1264309
def parse_response(self, connection, command_name, **options):
        ""
        try:
            response = connection.read_response()
        except ResponseError:
            if EMPTY_RESPONSE in options:
                return options[EMPTY_RESPONSE]
            raise
        if command_name in self.response_callbacks:
            return self.response_callbacks[command_name](response, **options)
        return response
537626
def parse_response(response)
      check_version_and_warn(response.headers[X_KONTENA_VERSION])

      if response.headers[CONTENT_TYPE] =~ JSON_REGEX
        parse_json(response)
      else
        response.body
      end
    end
512966
def _parse_remote_response(self, response):
        
        # Check if the content type is the right one.
        try:
            if response.headers["Content-Type"] != 'application/json':
                logger.warning('Wrong Content_type ({})'.format(
                    response.headers["Content-Type"]))
        except KeyError:
            pass

        logger.debug("Loaded JWKS: %s from %s" % (response.text, self.source))
        try:
            return json.loads(response.text)
        except ValueError:
            return None
418847
def parse_response(response)
      OpenStruct.new(
        raw_response: response,
        body: JSON.parse(response.body, symbolize_names: true)
      )
    end
1212970
def parse(self, response):
        """"""
        info = response.get('info')
        res = self._regex.search(info)

        self._processed += int(res.group(1))
        self._failed += int(res.group(2))
        self._total += int(res.group(3))
        self._time += Decimal(res.group(4))
        self._chunk += 1
1310174
def parse_response(self, response):
        
        parser, unmarshaller = self.getparser()
        parser.feed(response.text.encode('utf-8'))
        parser.close()
        return unmarshaller.close()
847389
def _stream_raw_result(self, response, chunk_size=1, decode=True):
        ''' '''
        self._raise_for_status(response)
        for out in response.iter_content(chunk_size, decode):
            yield out
653220
def parse_stream_raw(self, stream, debug=False):
        """"""
        tokens = tokenize.generate_tokens(stream.readline)
        return self.parse_tokens(tokens, debug)
94300
def parse_response(self, resp):
        
        p, u = self.getparser()
        p.feed(resp.content)
        p.close()
        return u.close()
1011772
def parse_response(response)
      if response.headers['Content-Type'] == "application/json"
        JSON.parse(response.body) rescue nil
      else
        response.body
      end
    end
1192090
async def _stream_raw_result(self, res):
        '''  '''
        async with res.context as response:
            response.raise_for_status()
            async for out in response.content.iter_chunked(1):
                yield out.decode()