简体   繁体   English

如何使用 Postman 在 get 请求中添加 Supabase Order by

[英]How to add Supabase Order by in get request using Postman

I need to add order in supabase result while calling the supabase bash in postman.我需要在 postman 中调用 supabase bash 时在 supabase 结果中添加顺序。

I am doing same in flutter like below我在 flutter 中做同样的事情,如下所示

Future getPropertiesFromBirmingham() async {
    var response = await client
        .from('properties')
        .limit(10)
        .order('created_at', ascending: false);

    return response;
  }

Need to use same in postman but not getting anything on this.需要在 postman 中使用相同但没有得到任何东西。

I didn't find much on this topic, Tried using order in params but it didn't work.我没有找到太多关于这个主题的信息,尝试在参数中使用 order 但它没有用。

You can get examples of cURL requests directly in Supabase API docs .您可以直接在Supabase API 文档中获取 cURL 请求的示例。 You can also check for more documentation directly in the PostgREST website.您还可以直接在PostgREST网站上查看更多文档。

curl 'https://supabase_project_ref.supabase.co/rest/v1/properties?limit=10&order=created_at.desc' \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"

You can also control where the NULLs will be (if any) by adding either of the following:您还可以通过添加以下任一选项来控制 NULL 的位置(如果有):

  • nullslast
  • nullsfirst
curl 'https://supabase_project_ref.supabase.co/rest/v1/properties?order=created_at.desc.nullslast' \
-H "apikey: SUPABASE_KEY" \
-H "Authorization: Bearer SUPABASE_KEY"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM