我需要知道如何发送HTTP删除请求,我已经实现了以下代码。
- (void) deleteSyncRequestWithURL:(NSString *) url
{
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:url]];
[request setHTTPMethod:@"DELETE"];
_connection = [[NSURLConnection connectionWithRequest:request delegate:self] retain];
}
但是我得到了404状态。
有人知道我缺什么吗?
附注:我正在使用xcode 3.2.3,模拟器4.0。