3
使用?x-http-method-override=PATCH
的HTTP POST請求正在作爲POST處理,而不是在Firebase REST API上進行PATCH調用。這在過去兩週已經開始發生。忽略Firebase x-http-method覆蓋參數
Firebase documentation仍然提到這個參數,這是不是準確的,或者這是Firebase中的錯誤?
特定的(Java)代碼在不直接支持PATCH的Google Appengine上運行。 (捕獲與App Engine兼容的Firebase SDK)
作爲參考,請求是使用以下代碼進行的,該響應指示沒有任何錯誤的成功請求。
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();