common / com.revenuecat.purchases.common / HTTPClient / performRequest

performRequest

fun performRequest(path: String, body: Map<String, Any?>?, headers: Map<String, String>): Result

Performs a synchronous web request to the RevenueCat API

Parameters

path - The resource being requested

body - The body of the request, for GET must be null

headers - Map of headers, basic headers are added automatically

Exceptions

JSONException - Thrown for any JSON errors, not thrown for returned HTTP error codes

IOException - Thrown for any unexpected errors, not thrown for returned HTTP error codes

Return
Result containing the HTTP response code and the parsed JSON body