Implements the Read Detail (read an object)

        maps to GET /api/objects/:id/ in rest semantics
        :param request: rip.Request
        :return: rip.Response
354395
def read_detail(self, request):
        
        pipeline = crud_pipeline_factory.read_detail_pipeline(
            configuration=self.configuration)
        return pipeline(request=request)
1347064
def get_id(request):
        
        if isinstance(request, etree._Element):
            elem = request
        else:
            if isinstance(request, Document):
                request = request.toxml()
            elem = fromstring(request, forbid_dtd=True)
        return elem.get('ID', None)
658520
def request_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/requests/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
564511
def record_get_details(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/getDetails' % object_id, input_params, always_retry=always_retry, **kwargs)
1205518
def retrieve(self, request, _id):
        
        _id = deserialize(_id)

        retrieved = self.collection.find_one({'_id': _id})
        if retrieved:
            return Response(serialize(retrieved))
        else:
            return Response(
                response=serialize(
                    DocumentNotFoundError(self.collection.__name__, _id)
                ),
                status=400
            )
1176082
def get_details(self, ids):
        
        if isinstance(ids, list):
            if len(ids) > 5:
                ids = ids[:5]
            id_param = ';'.join(ids) + '/'
        else:
            ids = str(ids)
            id_param = ids + '/'

        header, content = self._http_request(id_param)
        resp = json.loads(content)
        if not self._is_http_response_ok(header):
            error = resp.get('error_message', 'Unknown Error')
            raise HttpException(header.status, header.reason, error) 
        return resp
65064
def endpoint(request):
    
    s = getServer(request)

    query = util.normalDict(request.GET or request.POST)

    # First, decode the incoming request into something the OpenID
    # library can use.
    try:
        openid_request = s.decodeRequest(query)
    except ProtocolError, why:
        # This means the incoming request was invalid.
        return direct_to_template(
            request,
            'server/endpoint.html',
            {'error': str(why)})

    # If we did not get a request, display text indicating that this
    # is an endpoint.
    if openid_request is None:
        return direct_to_template(
            request,
            'server/endpoint.html',
            {})

    # We got a request; if the mode is checkid_*, we will handle it by
    # getting feedback from the user or by checking the session.
    if openid_request.mode in ["checkid_immediate", "checkid_setup"]:
        return handleCheckIDRequest(request, openid_request)
    else:
        # We got some other kind of OpenID request, so we let the
        # server handle this.
        openid_response = s.handleRequest(openid_request)
        return displayResponse(request, openid_response)
1265306
def read_object(ctx, pin, object_id):
    

    controller = ctx.obj['controller']

    def do_read_object(retry=True):
        try:
            click.echo(controller.get_data(object_id))
        except APDUError as e:
            if e.sw == SW.NOT_FOUND:
                ctx.fail('No data found.')
            elif e.sw == SW.SECURITY_CONDITION_NOT_SATISFIED:
                _verify_pin(ctx, controller, pin)
                do_read_object(retry=False)
            else:
                raise

    do_read_object()
595223
def get(cls, id):
        '''
        
        '''
        client = cls._new_api_client()
        return client.make_request(cls, 'get', url_params={'id': id})
401706
def request(self, req):
        
        data = json.dumps(req)
        req = urllib2.Request(self.url, data, self.headers)
        f = self.opener.open(req)
        resp = f.read()
        f.close()
        return json.loads(resp)
79050
def get(self, uri):
        
        request = None

        try:

            request = requests.get(
                self._url(uri),
                auth=self._auth_basic(),
                headers=self._header()
            )

            request.raise_for_status()

            try:
                return request.json()
            except Exception:
                return request

        except HTTPError:
            try:
                error = request.json()
                self.logger.error(error)
                err = error.get('detail', '')
            except:
                err = request
            raise NetworkAPIClientError(err)
        finally:
            self.logger.info('URI: %s', uri)
            if request:
                self.logger.info('Status Code: %s',
                                 request.status_code if request else '')
                self.logger.info('X-Request-Id: %s',
                                 request.headers.get('x-request-id'))
                self.logger.info('X-Request-Context: %s',
                                 request.headers.get('x-request-context'))
433120
def retrieve(self, request, *args, **kwargs):
        

        try:
            instance = self.get_object()
            serializer = self.get_serializer(instance)
            return Response(serializer.data)
        except Http404:
            pass

        lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field
        slug = self.kwargs[lookup_url_kwarg]

        # fall back to accession_temp_fallback
        try:
            tmp = get_object_or_404(
                self.queryset, accession_temp_fallback=slug)
            return HttpResponseRedirect(
                reverse(self.redirect_view_name, (tmp.slug, ))
            )
        except (Http404, FieldError):
            pass

        # fall back to embark ID
        try:
            embark = get_object_or_404(self.queryset, id=int(slug))
            return HttpResponseRedirect(
                reverse(self.redirect_view_name, (embark.slug, ))
            )
        except (Http404, ValueError):
            pass

        # fall back to alt slug
        try:
            from glamkit_collections.utils import alt_slugify
            alt_slug = alt_slugify(slug)
            alt = get_object_or_404(self.queryset, alt_slug=alt_slug)
            return HttpResponseRedirect(
                reverse(self.redirect_view_name, (alt.slug, ))
            )
        except Http404:
            pass

        # well, we tried
        raise Http404
268863
def read_request(file_name, **params):
    
    with open(file_name, 'r') as f:
        data = f.read()
        return read_request_from_str(data, **params)
521099
def get_object(self, request):
        
        pattern = request.GET.get('pattern', '')
        if len(pattern) < 3:
            raise ObjectDoesNotExist
        return pattern
719480
def request(self, request):
        

        url = "{}{}".format(self._base_url, request.path)

        timeout = self.poll_timeout

        if request.stream is True:
            timeout = self.stream_timeout

        try:
            http_response = self._session.request(
                request.method,
                url,
                headers=self._headers,
                params=request.params,
                data=request.body,
                stream=request.stream,
                timeout=timeout
            )
        except requests.exceptions.ConnectionError:
            raise V20ConnectionError(url)
        except requests.exceptions.ConnectTimeout:
            raise V20Timeout(url, "connect")
        except requests.exceptions.ReadTimeout:
            raise V20Timeout(url, "read")

        request.headers = http_response.request.headers

        response = Response(
            request,
            request.method,
            http_response.url,
            http_response.status_code,
            http_response.reason,
            http_response.headers
        )

        if request.stream:
            response.set_line_parser(
                request.line_parser
            )

            response.set_lines(
                http_response.iter_lines(
                    self.stream_chunk_size
                )
            )
        else:
            response.set_raw_body(http_response.text)

        return response
1107060
def fetch(api_request)
      uri = api_request.to_uri
      response = Net::HTTP.start(uri.host, use_ssl: api_request.ssl?) do |http|
        http.read_timeout = 5
        http.open_timeout = 5
        http.get uri.request_uri, REQUEST_HEADERS
      end

      handle_response(api_request, response)

    rescue Timeout::Error => e
      ErrorResponse.new(api_request, e.class.name).to_h
    end
924190
def parse(self, request):
        
        if request.method in ('POST', 'PUT', 'PATCH'):
            content_type = self.determine_content(request)
            if content_type:
                split = content_type.split(';', 1)
                if len(split) > 1:
                    content_type = split[0]
                content_type = content_type.strip()

            parser = self._meta.parsers_dict.get(
                content_type, self._meta.default_parser)
            data = parser(self).parse(request)
            return dict() if isinstance(data, basestring) else data
        return dict()