code: def request(self, method, uri, headers=None, bodyProducer=None):
          
          if self._parent_trace is None:
              trace = Trace(method)
          else:
              trace = self._parent_trace.child(method)
  
          if self._endpoint is not None:
              trace.set_endpoint(self._endpoint)
  
          if headers is None:
              headers = Headers({})
  
          # These headers are based on the headers used by finagle's tracing
          # http Codec.
          #
          # https://github.com/twitter/finagle/blob/master/finagle-http/
          #
          # Currently not implemented are X-B3-Sampled and X-B3-Flags
          # Tryfer's underlying Trace implementation has no notion of a Sampled
          # trace and I haven't figured out what flags are for.
          headers.setRawHeaders('X-B3-TraceId', [hex_str(trace.trace_id)])
          headers.setRawHeaders('X-B3-SpanId', [hex_str(trace.span_id)])
  
          if trace.parent_span_id is not None:
              headers.setRawHeaders('X-B3-ParentSpanId',
                                    [hex_str(trace.parent_span_id)])
  
          # Similar to the headers above we use the annotation 'http.uri' for
          # because that is the standard set forth in the finagle http Codec.
          trace.record(Annotation.string('http.uri', uri))
          trace.record(Annotation.client_send())
  
          def _finished(resp):
              # TODO: It may be advantageous here to return a wrapped response
              # whose deliverBody can wrap it's protocol and record when the
              # application has finished reading the contents.
              trace.record(Annotation.string(
                  'http.responsecode',
                  '{0} {1}'.format(resp.code, resp.phrase)))
              trace.record(Annotation.client_recv())
              return resp
  
          d = self._agent.request(method, uri, headers, bodyProducer)
          d.addBoth(_finished)
  
          return d
docs: Send a client request following HTTP redirects.
  
          @see: L{Agent.request}.