AnalyticsRequestV2

@Serializable
data class AnalyticsRequestV2 : StripeRequest

Analytics request sent to r.stripe.com, which is the preferred service for analytics. This is a POST request with MimeType.Form ContentType.

It sets two headers required by r.stripe.com - HEADER_ORIGIN - Set from analytics server HEADER_USER_AGENT - Used for parsing client info, needs to conform the format starting with "Stripe/v1"

It sets four params required r.stripe.com - PARAM_CLIENT_ID - A string identifying the client making the request, set from analytics server PARAM_CREATED - Timestamp when the event was created in seconds PARAM_EVENT_NAME - An identifying name for this type of event PARAM_EVENT_ID - UUID used to deduplicate events

Additional params can be passed as constructor parameters.

Properties

Link copied to clipboard
Link copied to clipboard
open override val headers: Map<String, String>

The HTTP headers attached to this request

Link copied to clipboard
open override val method: StripeRequest.Method

The type(Get/Post/Delete) of this request.

Link copied to clipboard
open override val mimeType: StripeRequest.MimeType

The MimeType of this request, determines the header and body format for a POST request

Link copied to clipboard
val params: JsonElement
Link copied to clipboard

Additional HTTP headers attached if this is a POST request

Link copied to clipboard
open override val retryResponseCodes: Iterable<Int>

A range of HTTP response code indicating this request should be retried

Link copied to clipboard
open val shouldCache: Boolean = false

Whether the response should be cached or not

Link copied to clipboard
open override val url: String

The url of the request, could be concatenated with query params

Functions

Link copied to clipboard
Link copied to clipboard
open override fun writePostBody(outputStream: OutputStream)

Writes the body of a POST request with OutputStream, left empty for non-POST requests