需要帮助使用AsiHttpRequest
问题描述:
我有这样的代码:需要帮助使用AsiHttpRequest
- (void)postRequestWithURLState:(NSString *)url
{
NSString *bodyRequest = nil;
NSURL *requestURL = [NSURL URLWithString:url];
NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] init];
//NSLog(@"-------------- bodyRequest: %@", bodyRequest);
[theRequest setURL:requestURL];
[theRequest setTimeoutInterval:0.5];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody:[bodyRequest dataUsingEncoding:NSASCIIStringEncoding]];
[self.oauthAuthentication authorizeRequest:theRequest];
NSURLConnection *conn = [NSURLConnection connectionWithRequest:theRequest delegate:self];
self.web = conn;
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
难道不可能性做使用AsiHttpRequest同样的事情? 我在文档中找不到像[self.oauthAuthentication authorizeRequest:theRequest];
答
我正在使用https://github.com/keybuk/asi-http-request-oauth签署我的ASIHTTPRequest和ASIFormDataRequest对象。它工作得很好,很容易集成,只需检查自述文件!