HttpDelete with body

Have you tried overriding HttpEntityEnclosingRequestBase as follows: import org.apache.http.client.methods.HttpEntityEnclosingRequestBase; import java.net.URI; import org.apache.http.annotation.NotThreadSafe; @NotThreadSafe class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase { public static final String METHOD_NAME = “DELETE”; public String getMethod() { return METHOD_NAME; } public HttpDeleteWithBody(final String uri) { super(); setURI(URI.create(uri)); } public HttpDeleteWithBody(final URI uri) { super(); setURI(uri); } public HttpDeleteWithBody() { super(); } } … Read more

How to specify DELETE method in a link or form?

Was trying to figure this out for a rails app that was using Angular on the front end; these seems to work for that environment: <a data-confirm=”Are you sure?” data-method=”delete” href=”https://stackoverflow.com/link-to-resource” rel=”nofollow”>Delete</a> Edit: Just to give everyone a heads up, I think you still need to have jQuery for this to work. I removed jQuery … Read more

DELETE using CURL with encoded URL

Since you are in a bash environment, you could encode the hash OXYugGKg207g5uN/07V before passing it to curl. A straight-forward approach would be to use its byte representation %4f%58%59%75%67%47%4b%67%32%30%37%67%35%75%4e%2f%30%37%56 To get that, call: echo -ne “OXYugGKg207g5uN/07V” | xxd -plain | tr -d ‘\n’ | sed ‘s/\(..\)/%\1/g’ It will give you: %4f%58%59%75%67%47%4b%67%32%30%37%67%35%75%4e%2f%30%37%56 The complete one-liner including … Read more

RESTful undelete

Going by the book: RFC 2616-9.7: The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from … Read more

How do I enable HTTP PUT and DELETE for ASP.NET MVC in IIS?

Go to Handler Mappings in your IIS Manager. Find ExtensionlessUrlHandler-Integrated-4.0, double click it. Click Request Restrictions… button and on Verbs tab, add both DELETE and PUT. Possible WebDav Publisher issue You’ve mention on a deleted post you were running on a 2008 server right? Try removing webDav role, or disable it from your site config: … Read more

Javascript: Fetch DELETE and PUT requests

Here is a fetch POST example. You can do the same for DELETE. function createNewProfile(profile) { const formData = new FormData(); formData.append(‘first_name’, profile.firstName); formData.append(‘last_name’, profile.lastName); formData.append(’email’, profile.email); return fetch(‘http://example.com/api/v1/registration’, { method: ‘POST’, body: formData }).then(response => response.json()) } createNewProfile(profile) .then((json) => { // handle success }) .catch(error => error);

Body of Http.DELETE request in Angular2

The http.delete(url, options) does accept a body. You just need to put it within the options object. http.delete(‘/api/something’, new RequestOptions({ headers: headers, body: anyObject })) Reference options interface: https://angular.io/api/http/RequestOptions UPDATE: The above snippet only works for Angular 2.x, 4.x and 5.x. For versions 6.x onwards, Angular offers 15 different overloads. Check all overloads here: https://angular.io/api/common/http/HttpClient#delete … Read more