【发布时间】:2013-02-14 23:21:34
【问题描述】:
您好,我有以下代码访问 URL:
NSString * stringURL = [NSString stringWithFormat:@"%@/%@/someAPI", kSERVICE_URL, kSERVICE_VERSION];
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:stringURL]];
AFJSONRequestOperation * operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
completionHandler(JSON, nil);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
completionHandler(nil, error);
}];
但我想将用户令牌作为参数传递给HEADER,例如X-USER-TOKEN。
在AFNetworking documentation上找不到,要不要改操作类型?
【问题讨论】:
标签: ios objective-c json afnetworking nsurlrequest