def prepare_request_dict(request_dict, endpoint_url, context=None, user_agent=None):
 r = request_dict
 if (user_agent is not None):
  headers = r['headers']
  headers['User-Agent'] = user_agent
 url = _urljoin(endpoint_url, r['url_path'])
 if r['query_string']:
  encoded_query_string = percent_encode_sequence(r['query_string'])
  if ('?' not in url):
   url += ('?%s' % encoded_query_string)
  else:
   url += ('&%s' % encoded_query_string)
 r['url'] = url
 r['context'] = context
 if (context is None):
  r['context'] = {}

def prepare_request_dict ( request_dict , endpoint_url , context = None , user_agent = None ) : r = request_dict if ( user_agent is not None ) : headers = r [ 'headers' ] headers [ 'User-Agent' ] = user_agent url = _urljoin ( endpoint_url , r [ 'url_path' ] ) if r [ 'query_string' ] : encoded_query_string = percent_encode_sequence ( r [ 'query_string' ] ) if ( '?' not in url ) : url += ( '?%s' % encoded_query_string ) else : url += ( '&%s' % encoded_query_string ) r [ 'url' ] = url r [ 'context' ] = context if ( context is None ) : r [ 'context' ] = { }
this method prepares a request dict to be created into an awsrequestobject .