AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Public Attributes | List of all members
upload.AbstractRpcServer Class Reference
Inheritance diagram for upload.AbstractRpcServer:
Inheritance graph
[legend]
Collaboration diagram for upload.AbstractRpcServer:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, host, auth_function, host_override=None, extra_headers={}, save_cookies=False)
 
def Send (self, request_path, payload=None, content_type="application/octet-stream", timeout=None, kwargs)
 
def __init__ (self, host, auth_function, host_override=None, extra_headers={}, save_cookies=False)
 
def Send (self, request_path, payload=None, content_type="application/octet-stream", timeout=None, kwargs)
 

Public Attributes

 host
 
 host_override
 
 auth_function
 
 authenticated
 
 extra_headers
 
 save_cookies
 
 opener
 

Detailed Description

Provides a common interface for a simple RPC server.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def upload.AbstractRpcServer.__init__ (   self,
  host,
  auth_function,
  host_override = None,
  extra_headers = {},
  save_cookies = False 
)
Creates a new HttpRpcServer.

Args:
  host: The host to send requests to.
  auth_function: A function that takes no arguments and returns an
(email, password) tuple when called. Will be called if authentication
is required.
  host_override: The host header to send to the server (defaults to host).
  extra_headers: A dict of extra headers to append to every request.
  save_cookies: If True, save the authentication cookies to local disk.
If False, use an in-memory cookiejar instead.  Subclasses must
implement this functionality.  Defaults to False.

◆ __init__() [2/2]

def upload.AbstractRpcServer.__init__ (   self,
  host,
  auth_function,
  host_override = None,
  extra_headers = {},
  save_cookies = False 
)
Creates a new HttpRpcServer.

Args:
  host: The host to send requests to.
  auth_function: A function that takes no arguments and returns an
(email, password) tuple when called. Will be called if authentication
is required.
  host_override: The host header to send to the server (defaults to host).
  extra_headers: A dict of extra headers to append to every request.
  save_cookies: If True, save the authentication cookies to local disk.
If False, use an in-memory cookiejar instead.  Subclasses must
implement this functionality.  Defaults to False.

Member Function Documentation

◆ Send() [1/2]

def upload.AbstractRpcServer.Send (   self,
  request_path,
  payload = None,
  content_type = "application/octet-stream",
  timeout = None,
  kwargs 
)
Sends an RPC and returns the response.

Args:
  request_path: The path to send the request to, eg /api/appversion/create.
  payload: The body of the request, or None to send an empty request.
  content_type: The Content-Type header to use.
  timeout: timeout in seconds; default None i.e. no timeout.
(Note: for large requests on OS X, the timeout doesn't work right.)
  kwargs: Any keyword arguments are converted into query string parameters.

Returns:
  The response body, as a string.

◆ Send() [2/2]

def upload.AbstractRpcServer.Send (   self,
  request_path,
  payload = None,
  content_type = "application/octet-stream",
  timeout = None,
  kwargs 
)
Sends an RPC and returns the response.

Args:
  request_path: The path to send the request to, eg /api/appversion/create.
  payload: The body of the request, or None to send an empty request.
  content_type: The Content-Type header to use.
  timeout: timeout in seconds; default None i.e. no timeout.
(Note: for large requests on OS X, the timeout doesn't work right.)
  kwargs: Any keyword arguments are converted into query string parameters.

Returns:
  The response body, as a string.

Member Data Documentation

◆ auth_function

upload.AbstractRpcServer.auth_function

◆ authenticated

upload.AbstractRpcServer.authenticated

◆ extra_headers

upload.AbstractRpcServer.extra_headers

◆ host

upload.AbstractRpcServer.host

◆ host_override

upload.AbstractRpcServer.host_override

◆ opener

upload.AbstractRpcServer.opener

◆ save_cookies

upload.AbstractRpcServer.save_cookies

The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0