How to get rest api pagination headers via fetch

You have to use res.headers.get("X-WP-TotalPages") or res.headers.get("X-WP-Total") to get the header values. See the MDN Fetch documentation’s Headers section.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)