getAccountCsrfWithHttpInfo method
IssueCSRFToken mints the anti-forgery token a browser echoes as X-CSRF-Token on every change it asks for.
IssueCSRFToken mints the anti-forgery token a browser echoes as X-CSRF-Token on every change it asks for. The token is bound to the caller's validated identity and expires, so one minted for one identity cannot authorize a change as another. It is answered no-store, so it is never cached by a shared proxy. This is the same-origin endpoint the embedded console reads — the Same-Origin Policy is what stops a cross-site page from reading the response and forging a change.
Note: This method returns the HTTP Response.
Implementation
Future<Response> getAccountCsrfWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/v1/account/csrf';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}