Home > Software engineering >  Firebase GET request orderby 400 bad request
Firebase GET request orderby 400 bad request

Time:07-02

For a get request, I am trying to user order by like below but always get a 400 bad request. Here, multiple users can have multiple blog posts each with a unique id like b1 in screenshot below. The long sequence of characters is the uid of a user under blogs. Each user has their own uid.

https://assignment-c3557-default-rtdb.asia-southeast1.firebasedatabase.app/blogs.json?orderBy="createdAt"

I followed the documentation here

enter image description here

CodePudding user response:

As I said in my previous comment, this URL is invalid:

https://assignment-c3557-default-rtdb.asia-southeast1.firebasedatabase.app/blogs.json/orderBy="createdAt"
                                                                                     ^

The query portion of a URL starts with a ? character.

https://assignment-c3557-default-rtdb.asia-southeast1.firebasedatabase.app/blogs.json?orderBy="createdAt"
                                                                                     ^

CodePudding user response:

Firebase Realtime Database - Adding query to Axios GET request?

I followed the above similar issue resolution to solve my problem

  • Related