0

I am trying to PATCH (partially update) Firebase records (firebase.com). This works perfect outside of Google Apps Script using PATCH. GAS is not supporting PATCH and I tried X-HTTP-Method-Override without success. Using GAS with X-HTTP-Method-Override renders the same result as a standard GET. There is no security on my test database. No log-in is required.

var myPayload = "{\"WSD124\" : {\"auction\" : {\"stockno\" : \"ESD124\", \"highbid\" : \"240\"}}}";

var myURL = "https://mydatabase.firebaseio.com/auctions/.json";

var options = { headers: { "X-HTTP-Method-Override" : "PATCH" }, method: "POST", payload: myPayload };

var oResponse = UrlFetchApp.fetch(myURL,options);

2 Answers2

3

A quick update for those coming back to this old thread - we now support X-HTTP-Method-Override headers on all REST API calls, so this should now work

Chris Raynor
  • 1,675
  • 11
  • 13
1

UPDATE

This is now supported. See Chris Raynor's answer.

OLD ANSWER

We don't currently support X-HTTP-Method-Override though we are considering it. For now you'll likely have to do a PUT with the whole record. Give us an email at support@firebase.com if this is significantly blocking you.

Kato
  • 40,352
  • 6
  • 119
  • 149
Michael Lehenbauer
  • 16,229
  • 1
  • 57
  • 59