小编UnS*_*aid的帖子

发送http删除请求

我需要如何发送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];    
}
Run Code Online (Sandbox Code Playgroud)

但我有404状态.

有谁知道我错过了什么?

PS:我正在使用xcode 3.2.3,模拟器4.0

iphone nsurlconnection nsmutableurlrequest ios http-delete

5
推荐指数
1
解决办法
5287
查看次数