I observed it's using a HEAD Http Method when coun...
# gotrue
o
I observed it's using a HEAD Http Method when count=exact and head=true. Since HEAD doesn't have a body, i couldn't help but wonder how the count data was transmitted.
g
Not sure why you posted in gotrue section.... It comes back in the range header.... See https://postgrest.org/en/stable/api.html#exact-count From postgrest.js code on how to read the range header
Copy code
const countHeader = this.headers['Prefer']?.match(/count=(exact|planned|estimated)/)
        const contentRange = res.headers.get('content-range')?.split('/')
        if (countHeader && contentRange && contentRange.length > 1) {
          count = parseInt(contentRange[1])
        }
o
Thanks @garyaustin. Very helpful.
Should i have posted in Javascript?
g
gotrue is auth stuff, js or help for next time
o
Noted!
Thanks again.