refreshSessionWithHttpInfo method

Future<Response> refreshSessionWithHttpInfo(
  1. String sessionId, {
  2. RefreshSessionRequest? refreshSessionRequest,
})

Refresh a session

Refreshes a session by creating a new session token. A 401 is returned when there are validation errors, which signals the SDKs to fall back to the handshake flow.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<http.Response> refreshSessionWithHttpInfo(
  String sessionId, {
  RefreshSessionRequest? refreshSessionRequest,
}) async {
  // ignore: prefer_const_declarations
  final path =
      r'/sessions/{session_id}/refresh'.replaceAll('{session_id}', sessionId);

  // ignore: prefer_final_locals
  Object? postBody = refreshSessionRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}