How can I get back the Headers of a Collection or GET REST API call?

Hey :wave:

I’m using Full-Text Search on a Supabase table. So for this, I’m obliged to use a REST API call as WeWeb’s Supabase plugin doesn’t handle this use-case.

I want to add pagination on top of this. The thing is, Supabase (and PostgREST) send back the current range as response headers (NOT in the actual payload). So I need to store this header’s value to handle my own custom pagination.

So, instead of a collection (where we can’t see response headers, btw, that would be a useful feature), I switched to a REST API call that I trigger on page load. But it seems that I can get back the response headers as it’s a GET request.

Is there any way to get the Header or am I missing something?

Here’s a small video to explain the case:

Thanks a lot for your help :pray:

1 Like

No way this is you man. I was thinking about where you gone after leaving my mustache grow. You can use full text search with the Supabase plugin in WeWeb. It’s just the shitty naming, I also fell for that. This filter will let you use the Full Text Search.

1 Like

Hey man thanks!

I managed to make it work (even if the setup was unclear). But I still don’t have my range Header back from the Response.

I think I can “cheat” by computing the number of ranges from the count and keep count of the current range internally, but that’s over-engineered for such a simple thing…

I’d probably go straight for a Stored Procedure, you can use the FTS also there. And you can construct your response however you need it. For “complex” things like this I just make my own (security definer) stored procedure and call it. It’s supafast. Otherwise, you can use Axios which is in WeWeb and get all the infos you need.

1 Like