Praman — AI-First SAP UI5 Test Automation Platform - v1.0.1
    Preparing search index...

    Function fetchCSRFToken

    • Fetches a CSRF token from an OData service using a HEAD request.

      Parameters

      • page: ODataCSRFPage

        Playwright Page with request API (or compatible subset).

      • serviceUrl: string

        The OData service root URL.

      Returns Promise<CSRFTokenResult>

      The CSRF token and service URL.

      ODataError if the token cannot be fetched.

      const { token } = await fetchCSRFToken(page, '/sap/opu/odata/sap/API_PRODUCT_SRV/');