new Request(opts)
Snapchat wrapper for HTTP requests
Parameters:
| Name | Type | Description | 
|---|---|---|
| opts | Object | 
- Source:
Methods
- 
    <static> get(endpoint, cb) → {Request}
- 
    
    
    
    
    
    
    
        Parameters:Name Type Description endpointstring The endpoint of the request relative to the base URL. cbfunction - Source:
 Returns:new Request wrapping this HTTP GET request - Type
- Request
 
- 
    <static> post(endpoint, params, gauth, token, opts, cb) → {Request}
- 
    
    
    
    
    
    
    
        Parameters:Name Type Argument Description endpointstring <optional> 
 Optional endpoint of the request relative to the base URL. paramsObject <optional> 
 Optional parameters for the request. gauthstring <optional> 
 Optional parameter set to the X-Snapchat-Client-Auth-Token header field. tokenstring <optional> 
 Optional snapchat auth token returned from logging in. optsObject <optional> 
 Optional custom options. cbfunction - Source:
 Returns:new Request wrapping this HTTP POST request. - Type
- Request
 
- 
    <static> postCustom(endpoint, params, headers, token, opts, cb) → {Request}
- 
    
    
    
    
    
    
    
        Parameters:Name Type Argument Description endpointstring endpoint of the request relative to the base URL. paramsObject parameters for the request. headersObject Custom HTTP headers for this request. tokenstring snapchat auth token returned from logging in. optsObject <optional> 
 Optional custom options. cbfunction - Source:
 Returns:new Request wrapping this HTTP POST request. - Type
- Request
 
- 
    <static> sendEvents(eventData, cb) → {Request}
- 
    
    
    
    
    
    
    
        Parameters:Name Type Description eventDataObject cbfunction - Source:
 Returns:new Request wrapping this events HTTP POST request - Type
- Request
 
- 
    _initGET()
- 
    
    
    Automatically adds HTTP header fields: - User-Agent
- Accept-Language
- Accept-Locale
- Content-Type
 - Source:
 
- 
    _initPOST()
- 
    
    
    Automatically adds query parameters: - timestamp
- req_token Automatically adds HTTP header fields:
- User-Agent
- Accept-Language
- Accept-Locale
- Content-Type
 - Source:
 
- 
    start(cb)
- 
    
    
    Initiates the underlying HTTP request Request.httpRequest. Parameters:Name Type Description cbfunction - Source: