Post request to firebase without unique key

后端 未结 1 1348
Happy的楠姐
Happy的楠姐 2021-01-14 07:14

I want to post new data to my firebase API, but everytime I do so, a new key, like -L545gZW7E6Ed6iqXRok is generated with my object inside it. I would like to s

1条回答
  •  花落未央
    2021-01-14 07:22

    When you use the POST verb, Firebase generates a new location. This is in line with REST-ful idioms: POST is used to create a new object in a server-defined new location.

    If you want to write to an existing location, or a new location you control, use the PUT verb. In this case the data will be written to exactly the location you specify in the URL, and it will overwrite any existing data at that location.

    If you want to update part of the data at an existing location, but leave other pieces of the data unmodified, use the PATCH verb.

    If your HTTP client doesn't support specifying a verb, you can optionally pass the verb as HTTP-Method-Override header.

    0 讨论(0)
提交回复
热议问题