Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some REST APIs accept entity bodies for DELETE requests. This allows the DELETE to have a body.
- Loading branch information
David Abdemoulaie
committed
Oct 7, 2015
1 parent
4380dc6
commit 123c087
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.manticore; | ||
|
||
import java.net.URI; | ||
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; | ||
|
||
public class HttpDeleteWithEntity extends HttpEntityEnclosingRequestBase { | ||
public final static String METHOD_NAME = "DELETE"; | ||
|
||
public HttpDeleteWithEntity() { | ||
super(); | ||
} | ||
|
||
public HttpDeleteWithEntity(URI url) { | ||
super(); | ||
setURI(url); | ||
} | ||
|
||
public HttpDeleteWithEntity(String url) { | ||
super(); | ||
setURI(URI.create(url)); | ||
} | ||
|
||
@Override | ||
public String getMethod() { | ||
return METHOD_NAME; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters