[TIMOB-14954] iOS: ASI HTTP Library converts DELETE requests to POST requests
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-03T23:50:36.000+0000 |
Affected Version/s | Release 3.1.3 |
Fix Version/s | 2014 Sprint 05, 2014 Sprint 05 API, Release 3.2.3, Release 3.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Rick Blalock |
Assignee | Vishal Duggal |
Created | 2013-08-23T14:59:03.000+0000 |
Updated | 2014-03-24T21:54:21.000+0000 |
Description
The ASIHTTP lib converts DELETE requests to POST. Reference the file here: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/ASI/ASIHTTPRequest.m#L561
Per a typical RESTful service, DELETE is a normal verb used for...deleting a resource. This needs to be supported.
The HTTP client object should support ALL verbs, in particular those in RFC 2616 (http://ietf.org/rfc/rfc2616). See http://annevankesteren.nl/2007/10/http-methods for an even more comprehensive list.
Why would it be invalid?
I agree with Tim that all REST verbs should be supported and not converted.
I need to demo a rest api adapter for Cisco this week demonstrating we can do at a minimum GET, POST, PUT, DELETE.. Let me know if this can be pushed in with 3.2.0 SDK
we are also doing some work for demoing an interface layer that leverages HTTP verbs - as a core demo for our platform. Anything we can do to push this into 3.2 would be huge.
master - https://github.com/appcelerator/titanium_mobile/pull/5411
Backport for 3.2.X https://github.com/appcelerator/titanium_mobile/pull/5412
Note to QE. Do not close ticket till backport PR is merged for 3.2.3 release.
Closing ticket as fixed. Verified two cases: 1. The failure case (this ticket), which is using SDK 3.2.2.GA, was able to *successfully* send a DELETE request to a POST url 2. The fix, which is using SDK 3.2.3 and 3.3.0, was able to send a DELETE request to a POST url and receive a *405 error code* from the server (expected) Using the default Titanium Classic app, I used this code to verify the fix:
*Tested on:* Appcelerator Studio, build: 3.2.3.201403190645 SDK build: 3.2.3.v20140324094107, 3.3.0.v20140324131123 CLI: 3.2.1 Xcode: 5.1 Devices: iphone 5 (7.0.6), iphone 5s (7.1)