Firebase x-http-method-override parameter is ignored

HTTP POST requests using are ?x-http-method-override=PATCH

treated as POST instead of PATCH calls in the Firebase REST API. This has started to happen over the past two weeks.

The Firebase documentation still mentions this setting, isn't it more accurate or is it a bug in Firebase?

The concrete (Java) code works in Google Appengine where PATCH is not directly supported. (Overcoming App Engine Compatible Firebase SDK)

For reference, the request is executed with the following code, the response indicates a successful request without any errors.

HttpRequestFactory requestFactory = HTTP_TRANSPORT.createRequestFactory(new 
HttpRequestInitializer() {
    @Override
    public void initialize(HttpRequest request) {
        request.setParser(new JsonObjectParser(JSON_FACTORY));
    }
});
String path = url+".json"+"?x-http-method-override=PATCH";
GenericUrl fullUrl = new GenericUrl(path);

JsonHttpContent content = new JsonHttpContent(JSON_FACTORY, data);
content.setMediaType(new HttpMediaType("application/json; charset=UTF-8"));
HttpRequest request = requestFactory.buildPostRequest(fullUrl,content);
HttpResponse response = request.execute();

      

+3


source to share


1 answer


firebaser here

This issue, unfortunately, was recently implemented in Firebase server side REST request handling. We expect we will fix it by June 1st.



Until that time, you will need to pass the correct HTTP verb or request header in order to get the PATCH behavior. Sorry, I have no news right now.

+2


source







All Articles