File tree Expand file tree Collapse file tree 3 files changed +46
-3
lines changed
src/main/java/com/arangodb/internal Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 40
40
import org .apache .http .client .ClientProtocolException ;
41
41
import org .apache .http .client .config .RequestConfig ;
42
42
import org .apache .http .client .methods .CloseableHttpResponse ;
43
- import org .apache .http .client .methods .HttpDelete ;
44
43
import org .apache .http .client .methods .HttpEntityEnclosingRequestBase ;
45
44
import org .apache .http .client .methods .HttpGet ;
46
45
import org .apache .http .client .methods .HttpHead ;
@@ -256,7 +255,7 @@ private static HttpRequestBase buildHttpRequestBase(
256
255
final HttpRequestBase httpRequest ;
257
256
switch (request .getRequestType ()) {
258
257
case DELETE :
259
- httpRequest = new HttpDelete (url );
258
+ httpRequest = requestWithBody ( new HttpDeleteWithBody (url ), request );
260
259
break ;
261
260
case GET :
262
261
httpRequest = new HttpGet (url );
Original file line number Diff line number Diff line change
1
+ /*
2
+ * DISCLAIMER
3
+ *
4
+ * Copyright 2016 ArangoDB GmbH, Cologne, Germany
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ * Copyright holder is ArangoDB GmbH, Cologne, Germany
19
+ */
20
+
21
+ package com .arangodb .internal .http ;
22
+
23
+ import java .net .URI ;
24
+
25
+ import org .apache .http .client .methods .HttpEntityEnclosingRequestBase ;
26
+
27
+ /**
28
+ * @author Mark - mark at arangodb.com
29
+ *
30
+ */
31
+ public class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase {
32
+ public final static String METHOD_NAME = "DELETE" ;
33
+
34
+ public HttpDeleteWithBody (final String uri ) {
35
+ super ();
36
+ setURI (URI .create (uri ));
37
+ }
38
+
39
+ @ Override
40
+ public String getMethod () {
41
+ return METHOD_NAME ;
42
+ }
43
+
44
+ }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public static void log(
48
48
final ArangoSerialization util ) {
49
49
final RequestType requestType = request .getRequestType ();
50
50
final boolean includeBody = (requestType == RequestType .POST || requestType == RequestType .PUT
51
- || requestType == RequestType .PATCH ) && request .getBody () != null ;
51
+ || requestType == RequestType .PATCH || requestType == RequestType . DELETE ) && request .getBody () != null ;
52
52
final StringBuilder buffer = new StringBuilder ();
53
53
if (includeBody ) {
54
54
buffer .append ("\n " );
You can’t perform that action at this time.
0 commit comments