http-delete

IIS7.5 Gives 500 Internal Server Error when trying to use DELETE verb

余生颓废 提交于 2019-12-18 20:50:02
问题 I am trying to issue a DELETE to an IIS7.5 resource: DELETE http://198.252.206.16:48251/Test/foo.ashx HTTP/1.1 Accept: */* Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Host: 198.252.206.16:48251 Content-Length: 0 Connection: Keep-Alive Pragma: no-cache And the server responds with: HTTP/1.1 500

.NET Web API CORS PreFlight Request

喜你入骨 提交于 2019-12-17 10:49:20
问题 I have some trouble make PUT and DELETE CORS request to Web API on other domain. I've coded API by tutorial http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api#create-webapi-project. GET and POST Requests works fine, but DELETE and PUT doesn't. I get this message: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Failed to load resource: No 'Access-Control-Allow-Origin' header is present on the requested resource. When I

HTTP protocol's PUT and DELETE and their usage in PHP

▼魔方 西西 提交于 2019-12-17 10:17:06
问题 Introduction I've read the following: Hypertext Transfer Protocol (HTTP) is the life of the web. It's used every time you transfer a document, or make an AJAX request. But HTTP is surprisingly a relative unknown among some web developers. The HTTP verbs comprise a major portion of our “uniform interface” constraint and provide us the action counterpart to the noun-based resource. The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT , and

Using PUT and DELETE methods in Spring MVC

£可爱£侵袭症+ 提交于 2019-12-17 09:33:21
问题 I'm trying to use RequestMethod.PUT and RequestMethod.DELETE in Spring MVC controller (version 3.0.2). There are three methods mapped with a URL in the Spring controller class as follows (PUT, GET and POST respectively, for the demonstration purpose only). @RequestMapping(method = {RequestMethod.PUT}, value = {"admin_side/Temp"}, headers = {"content-type=multipart/form-data"}) public String update(@ModelAttribute("tempBean") TempBean tempBean, BindingResult error, Map model,

Spring @CrossOrigin does not work with DELETE method

荒凉一梦 提交于 2019-12-13 14:16:36
问题 Spring @CrossOrigin annotation does not work with DELETE methods. Example code (in Groovy): @CrossOrigin @RestController @RequestMapping('/rest') class SpringController { @RequestMapping(value = '/{fileName}', RequestMethod.DELETE) void deleteFile(@PathVariable fileName) { // logic } } For this code I get the exception: XMLHttpRequest cannot load http://localhost:8080/rest/filename.txt. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200

Jersey test - Http Delete method with JSON request

…衆ロ難τιáo~ 提交于 2019-12-11 09:54:47
问题 I am using Jersey Test to test Rest service DELETE method: @DELETE @Path("/myPath") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public MyResponse myMethod(MyRequest myRequest) { I have tried the example below and other methods: Entity<MyRequest> requestEntity = Entity.entity(new MyRequest(arg1, arg2), MediaType.APPLICATION_JSON); target(MY_URI).request(MediaType.APPLICATION_JSON).method("DELETE", requestEntity) and target(MY_URI).request(MediaType.APPLICATION

How can I perform a HTTP DELETE request with body?

萝らか妹 提交于 2019-12-11 06:42:03
问题 I want to perform a HTTP DELETE request with a xml in the body (not a form). How can I perform this HTTP DELETE request? I tried with HttpURLConnection but there are some limitations with it. I tried with the apache's HttpClient too. But I don't know how to send the xml without the structure of application/x-www-form-urlencoded . 回答1: This code will make it: try { HttpEntity entity = new StringEntity(jsonArray.toString()); HttpClient httpClient = new DefaultHttpClient(); HttpDeleteWithBody

PUT and DELETE getting 404 in WCF REST service .net 4 when running in IIS 6.0

吃可爱长大的小学妹 提交于 2019-12-10 17:24:17
问题 I've added the wildcard application mapping for c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll and unchecked the "verify that file exist" checkbox. This gives me GET and POST ability but not PUT and DELETE. I have both prohibited and allowed WebDav under the web service extensions. Application works like a champ when running in development environment. PUT and DELETE don't work when running app in IIS. Any help is appreciated. 回答1: Have you defined the extra verbs in the ISAPI

How to set RequestBody for Http Delete method.

爷,独闯天下 提交于 2019-12-10 14:43:39
问题 I am writing a client code for a server which Delete API. The API specification requires data to be sent. I am using HttpComponents v3.1 library for writing client code. Using the HtpDelete class I could not find a way to add request data to it. Is there a way to do so ? Below is the code snippet. HttpDelete deleteReq = new HttpDelete(uriBuilder.toString()); List<NameValuePair> postParams = new ArrayList<NameValuePair>(); postParams.add(new BasicNameValuePair(RestConstants.POST_DATA_PARAM

mod_rewrite: How to redirect HTTP DELETE and PUT

怎甘沉沦 提交于 2019-12-10 13:29:13
问题 Im trying to write a little rest api in php by using mod_rewrite. My question is: How do I handle HTTP DELETE and PUT? For example, the url would be: /book/1234 where 1234 is the unique id of a book. I want to "redirect" this id (1234) to book.php with the id as parameter. I already know how to read PUT and DELETE variables in the php script, but how do I set this rewrite rules in mod_rewrite? Any ideas? Edit: The rewriting rule for a GET would look like this: RewriteRule book/([0-9]+) book