def HttpRequest(service, operation, data, uri, extra_headers=None, url_params=None, escape_params=True, content_type='application/atom+xml'):
 full_uri = atom.service.BuildUri(uri, url_params, escape_params)
 (server, port, ssl, partial_uri) = atom.service.ProcessUrl(service, full_uri)
 if ssl:
  full_url = ('https://%s%s' % (server, partial_uri))
 else:
  full_url = ('http://%s%s' % (server, partial_uri))
 data_str = data
 if data:
  if isinstance(data, list):
   converted_parts = [__ConvertDataPart(x) for x in data]
   data_str = ''.join(converted_parts)
  else:
   data_str = __ConvertDataPart(data)
 headers = {}
 if isinstance(service.additional_headers, dict):
  headers = service.additional_headers.copy()
 if isinstance(extra_headers, dict):
  for (header, value) in extra_headers.iteritems():
   headers[header] = value
 if content_type:
  headers['Content-Type'] = content_type
 if (operation == 'GET'):
  method = urlfetch.GET
 elif (operation == 'POST'):
  method = urlfetch.POST
 elif (operation == 'PUT'):
  method = urlfetch.PUT
 elif (operation == 'DELETE'):
  method = urlfetch.DELETE
 else:
  method = None
 return HttpResponse(urlfetch.Fetch(url=full_url, payload=data_str, method=method, headers=headers))

def HttpRequest ( service , operation , data , uri , extra_headers = None , url_params = None , escape_params = True , content_type = 'application/atom+xml' ) : full_uri = atom . service . BuildUri ( uri , url_params , escape_params ) ( server , port , ssl , partial_uri ) = atom . service . ProcessUrl ( service , full_uri ) if ssl : full_url = ( 'https://%s%s' % ( server , partial_uri ) ) else : full_url = ( 'http://%s%s' % ( server , partial_uri ) ) data_str = data if data : if isinstance ( data , list ) : converted_parts = [ __ConvertDataPart ( x ) for x in data ] data_str = '' . join ( converted_parts ) else : data_str = __ConvertDataPart ( data ) headers = { } if isinstance ( service . additional_headers , dict ) : headers = service . additional_headers . copy ( ) if isinstance ( extra_headers , dict ) : for ( header , value ) in extra_headers . iteritems ( ) : headers [ header ] = value if content_type : headers [ 'Content-Type' ] = content_type if ( operation == 'GET' ) : method = urlfetch . GET elif ( operation == 'POST' ) : method = urlfetch . POST elif ( operation == 'PUT' ) : method = urlfetch . PUT elif ( operation == 'DELETE' ) : method = urlfetch . DELETE else : method = None return HttpResponse ( urlfetch . Fetch ( url = full_url , payload = data_str , method = method , headers = headers ) )
simulates an http call to the server .