我有这段代码:
- (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];
答案 0 :(得分:1)
我正在使用https://github.com/keybuk/asi-http-request-oauth来签署我的ASIHTTPRequest和ASIFormDataRequest对象。它工作得很好,很容易集成,只需查看README!