def generate_client_login_request_body(email, password, service, source, account_type='HOSTED_OR_GOOGLE', captcha_token=None, captcha_response=None):
 request_fields = {'Email': email, 'Passwd': password, 'accountType': account_type, 'service': service, 'source': source}
 if (captcha_token and captcha_response):
  request_fields['logintoken'] = captcha_token
  request_fields['logincaptcha'] = captcha_response
 return urllib.urlencode(request_fields)

def generate_client_login_request_body ( email , password , service , source , account_type = 'HOSTED_OR_GOOGLE' , captcha_token = None , captcha_response = None ) : request_fields = { 'Email' : email , 'Passwd' : password , 'accountType' : account_type , 'service' : service , 'source' : source } if ( captcha_token and captcha_response ) : request_fields [ 'logintoken' ] = captcha_token request_fields [ 'logincaptcha' ] = captcha_response return urllib . urlencode ( request_fields )
creates the body of the autentication request see URL#request for more details .